public static string SubstringAfterLast(this string self, string needle) { var index = self.IndexOf(needle); return index >= 0 ? self.Substring(index + needle.Length) : null; }