trunk/src/LythumOSL.Core/Helpers.cs
/// <summary>
/// Function removes more then 1 space symbol in string
/// leave only 1 space 
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
Function removes more then 1 space symbol in string
leave only 1 space
Function removes more then 1 space symbol in string leave only 1 space
public static string TrimMultipleSpaces (string data)
		{
			string retVal = string.Empty;
			bool spaceFound = false;
			foreach (char c in data)
			{
				if (c == ' ')
				{
					if (!spaceFound)
					{
						retVal += c;
						spaceFound = true;
					}
				}
				else
				{
					retVal += c;
					spaceFound = false;
				}
			}
			return retVal;
		}
public static string TrimMultipleSpaces ( string data ) { string retVal = string . Empty ; bool spaceFound = false ; foreach ( char c in data ) { if ( c == ' ' ) { if ( ! spaceFound ) { retVal += c ; spaceFound = true ; } } else { retVal += c ; spaceFound = false ; } } return retVal ; }
Function removes more then 1 space symbol in string
leave only 1 space
Function removes more then 1 space symbol in string leave only 1 space
None
data
string
None