String Splitting

Hello all,

I’m trying to parse a long string and get the host names from it, here is an example;


I’ve done various things using .Split(‘[‘); however, it seems like there must be a better way to break this down into 4 strings which I then pass to

 Uri myUri = new Uri(URL); host = myUri.Host; host_port = myUri.Port; 

Is this a LINQ thing?

I’ve tried googling about parsing with link, but I can’t figure out how to set a terminator char ]

Any thoughts, or can someone point me in the right direction to improve my string parsing skills?

Thanks so much!

submitted by /u/dbuzz111
[link] [comments]

Leave a Reply