Probably that's what you want:
~
Function Squash(ByVal input As String, ByVal character As Char) As
String
Return Regex.Replace(input, Regex.Escape(character) & "+",
character)
End Function
~
HTH,
Roman
<ji*******@hotmail.com> ???????/???????? ? ???????? ?????????:
news:11**********************@j73g2000cwa.googlegr oups.com...
I'd like to use regex to replace a specified character that repeats
two or more times with one instance of that character.
For example,
mystring = "a.....b"
regex squash (mystring, ".") -> "a.b"
Thanks for your help.
-Jim