String Splitting

Hello all,

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

[rtsp://admin:admin@192.168.1.4:88/videoMain][rtsp://admin:admin@192.168.1.41:554/axis-media/media.amp?videocodec=h264&streamprofile=Quality][rtmp://192.168.1.9/public/ButterStream][rtsp://admin:admin@192.168.1.55:88/videoMain]

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