Posts Tagged ‘Regular Expression’

How to Replace Multiple space with only one space

Use regular expression

RegexOptions options = RegexOptions.None;
Regex regex = new Regex(@”[ ]{2,}”, options);
tempo = regex.Replace(tempo, @” “);

VB.Net

Dim str As String = “Sample space 01″
Dim opts As RegexOptions = RegexOptions.None
Dim regx As New Regex(“[ ]{2,}”, opts)

str = regx.Replace(str, ” “)

,

No Comments



SetPageWidth