Str.cs
1 namespace Utils 2 { 3 public static class Str 4 { 5 public static string Between(string input, string open, string close) 6 { 7 var openI = input.IndexOf(open); 8 if (openI == -1) return input; 9 var openIndex = openI + open.Length; 10 var closeIndex = input.LastIndexOf(close); 11 if (closeIndex == -1) return input; 12 13 return input.Substring(openIndex, closeIndex - openIndex); 14 } 15 } 16 }