Lets say that I have something like this:
. . . . First . . Second. . . . . Third . . .
The desired output is:
.First.Second.Third.
How can I achieve this by using regular expressions? I have in mind something like this:
str = Regex.Replace(str, @"\.+", ".", RegexOptions.Multiline).Trim();
Tried it, doesn’t work.
If you have spaces between the dots, like it appears you do in the question, try:
This will convert any string of dots and spaces including at least a single dot.