trunk/src/LythumOSL.Core/Data/Fix.cs
/// <summary>
/// Function fixes all \n or \r tags 
/// and will make from group of these tags
/// one windows new line \r\n
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Function fixes all \n or \r tags
and will make from group of these tags
one windows new line \r\n
Function fixes all \ n or \ r tags and will make from group of these tags one windows new line \ r \ n
public static string FixNewLines (string input)
		{
			string retVal = string.Empty;
			bool newLineFound = false;
			foreach (char c in input)
			{
				if (c.Equals ('\r') ||
					c.Equals ('\n'))
				{
					newLineFound = true;
				}
				else
				{
					if (newLineFound)
					{
						newLineFound = false;
						retVal += "\r\n";
					}
					retVal += c;
				}
			}
			return retVal;
		}
public static string FixNewLines ( string input ) { string retVal = string . Empty ; bool newLineFound = false ; foreach ( char c in input ) { if ( c . Equals ( ' \r ' ) || c . Equals ( ' \n ' ) ) { newLineFound = true ; } else { if ( newLineFound ) { newLineFound = false ; retVal += " \r \n " ; } retVal += c ; } } return retVal ; }
Function fixes all \n or \r tags
and will make from group of these tags
one windows new line \r\n
Function fixes all \ n or \ r tags and will make from group of these tags one windows new line \ r \ n
None
input
string
None