[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RegExp.Replace


Public Function ClearDuplicateSpaces(InText As String) As String

  While (InStr(InText, "  ") > 0)
    InText = Replace(InText, "  ", " ")
  Wend
  Return InText

End


On 2/12/25 3:13 pm, CD wrote:
Hello,

I have a string like this:

Dim s As String = "A     B    C D   E"

s = RegExp.Replace(s, "\\s+", " ")

Print s

I would like to get "A B C D E"

What should I write in the Pattern string?
I've tried many things, without success.
So what should I change to get the desired result?

Regards

Follow-Ups:
Re: RegExp.ReplaceBruce Steers <bsteers4@xxxxxxxxx>
References:
RegExp.ReplaceCD <dessere.claude@xxxxxx>