The below code will help developers to reduce the multiple (white)blank spaces in a string and convert into single space. This program is using regular expression to remove multiple spaces. while there is other ways are available to achieve the same.
using System;
namespace BlankSpaces_MyApp
{
class _class
{
public static void Main(string[] args)
{
string str = " Software Development Using C# - C# Tutorials ";
string NewString = System.Text.RegularExpressions.Regex.Replace(str, @"\s+", " ");
Console.WriteLine(NewString);
Console.Read();
}
}
}
Well, Great! Good thought-out info. Turning attention on cheapest solutions in house insurance, it is the best way to receive cheap house insurance.
ReplyDeleteThank you so much. It was very helpful for me..
ReplyDeleteBr.
Rony