c# get substring after character code example
Example 1: substring c# after character
var result = str.Substring(str.LastIndexOf('-') + 1);
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);