WikiCrawler/Utility/StringUtility.cs
/// <summary>
/// Removes all line returns more than two in a row.
/// </summary>
Removes all line returns more than two in a row.
Removes all line returns more than two in a row .
public static string RemoveExtraneousLines(this string text)
	{
		string[] lines = text.Split(RawLineBreak, System.StringSplitOptions.None);
		string result = "";
		bool lastLineBlank = true;
		foreach (string line in lines)
		{
			bool thisLineBlank = string.IsNullOrWhiteSpace(line);
			if (thisLineBlank && lastLineBlank)
			{
				continue;
			}
			result = Join("\n", result, line);
			lastLineBlank = thisLineBlank;
		}
		return result;
	}
public static string RemoveExtraneousLines ( this string text ) { string [ ] lines = text . Split ( RawLineBreak , System . StringSplitOptions . None ) ; string result = " " ; bool lastLineBlank = true ; foreach ( string line in lines ) { bool thisLineBlank = string . IsNullOrWhiteSpace ( line ) ; if ( thisLineBlank && lastLineBlank ) { continue ; } result = Join ( " \n " , result , line ) ; lastLineBlank = thisLineBlank ; } return result ; }
Removes all line returns more than two in a row.
Removes all line returns more than two in a row .
string
this