c# substring a word code example
Example 1: c# get first 5 characters of string
string result = str.Substring(0,5);
Example 2: get text after word C#
string myString = "hi there\ IP:127.0.0.1"
string toBeSearched = "IP:";
string ipaddr = myString.Substring(myString.IndexOf(toBeSearched) + toBeSearched.Length);