I have a string with carriage returns in it I separate them using the following split:
string[] RemoveEmptySpace = result.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
so it becomes like this:
Server: xxx
Address: xxx.xxx.11.10
Non-authoritative answer:
Name: test.com
Address: xxx.xxx.888.555
now my question is how do i get the first instance of Address numbers only not the text e.g.’xxx.xxx.11.10′? the string comes from nslookup so it is dynamic the position may change…
Thanks
You could iterate over the collection of strings you got from the split, and parse those beginning with “Address”. i.e. something like this: