Stripping non-breaking spacesfrom FreeTextBox

146 Views Asked by At

I've not had this problem before and I'm stumped. Using FTB and cannot find a way to strip non-breaking spaces ( ) from the text entry into and out of sql2008r2. I've done this many, many times with regular textboxes and textareas, but this has me done in. I've tried simple replace(string," ","") on the page without luck, but prefer to use a regex. And, neither of these works:

Regex.Replace(endStr, "(Â){1,999}", "", RegexOptions.IgnoreCase);

Regex.Replace(endStr, "( ){1,999}", "", RegexOptions.IgnoreCase);

Never mind, found this and it works great:

Regex.Replace(endStr, "\s+", " ",  RegexOptions.IgnoreCase);
1

There are 1 best solutions below

0
On

\p{Z}+ should work even better if your textbox is going to deal with asian languages as their spacing characters differ from standard Unicode values.