how to get a part of string starting and ending with something c# code example Example: substring c# after character var result = str.Substring(str.LastIndexOf('-') + 1);