CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    3

    How To Split A String?

    Im currently working on a C# project that requires the use of proxies.


    Code:
    String WholeProxy = "127.0.0.1:80";
    String Address = Here I need to split "WholeProxy" to get just the "127.0.0.1";
    int Port = Here I need to split "WholeProxy" to get just the "80";
    WebProxy WP = new WebProxy(Address,Port);
    Does anyone know how to do this?


    Thanks,
    BuckleyInDaHouse.

  2. #2
    Join Date
    Feb 2003
    Location
    Gainesville, FL
    Posts
    7

    Re: How To Split A String?

    Code:
    string[] AddressAndPort = WholeProxy.Split(new Char[] { ':' });
    string Address = AddressAndPort[0];
    int Port = Convert.ToInt32(AddressAndPort[1]);

  3. #3
    Join Date
    Apr 2008
    Posts
    3

    Re: How To Split A String?

    Wow, thank you so much. This fixed my problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured