WikiCrawler/Utility/StringUtility.cs
/// <summary>
/// Removes the start and end strings from the start and end of the string if they only occur there.
/// </summary>
Removes the start and end strings from the start and end of the string if they only occur there.
Removes the start and end strings from the start and end of the string if they only occur there .
public static string TrimSoloPair(this string text, string start, string end)
	{
		if (text.StartsWith(start) && text.EndsWith(end) && text.IndexOf(start, 1) < 0)
		{
			text = text.Substring(start.Length, text.Length - start.Length - end.Length);
		}
		return text;
	}
public static string TrimSoloPair ( this string text , string start , string end ) { if ( text . StartsWith ( start ) && text . EndsWith ( end ) && text . IndexOf ( start , 1 ) < 0 ) { text = text . Substring ( start . Length , text . Length - start . Length - end . Length ) ; } return text ; }
Removes the start and end strings from the start and end of the string if they only occur there.
Removes the start and end strings from the start and end of the string if they only occur there .
string
this
start
string
end
string