namespace System.Reactive { public static class StringExtensions { public static string GetSubstring(this string source, string startMarker, string endMarker) { int startIndex = source.IndexOf(startMarker); int begin = startIndex + startMarker.Length; string result; if (endMarker == null) { result = source.Substring(begin); } else { int end = source.IndexOf(endMarker, begin); result = source.Substring(begin, end - begin); } return result; } } }