|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Regex squashI'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 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 <jim_ad***@hotmail.com> ???????/???????? ? ???????? ?????????: Show quoteHide quote news:1147275517.879711.300760@j73g2000cwa.googlegroups.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 >
OpenGL Control Flickering Problem
RegEx for splitting comma delimited text, HOW Control for Sql Connection? running app on network drive how to get excel col. letter Attaching a thread My.settings questions Reading Binary file created by VC++ Operation must use an updateable query EXCEPTION when trying to update excel How to connect/disconnect to remote machine using VPN programmatic |
|||||||||||||||||||||||