The code I gave almost does this, just get rid of the comma after the 50 -->
Regex r = new Regex(@"(?<string>\S{50})", RegexOptions.Compiled |
RegexOptions.Multiline | RegexOptions.ExplicitCapture);
string newString = r.Replace(YOURSTRINGHERE, "${string} ");
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Amith Singh" <Am******@hotmail.com> wrote in message
news:OF**************@TK2MSFTNGP11.phx.gbl...
My requirement is, in a string if any word is more than 50 characetrs add
one blank space and continue with the rest of the string. To have a string
which do not have any word more than 50 characters. The idea is to split
the word.
Thanks,
Amith
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn**************************@140.99.99.130... "Amith Singh" <Am******@hotmail.com> wrote in
news:Op**************@TK2MSFTNGP15.phx.gbl:
I would like to write a function which reads a string and adds one
blank space if any word is greater than 50 characters. How to write
these kind of functions using regular expressions.
Where do you want to place the blank space?
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/