Possible Duplicate:
How do I replace multiple spaces with a single space in C#?
I have a TextBox in which user is going to enter search Criteria in TEXTBOX. Now, i want to prevent the user from entering NOT MORE THAN ONE SPACE AFTER EACH WORD in TEXTBOX. How to do it in C#.
Thanks in Advance!
If you are looking to do it via the server side you could do a simple regex that would replace any double spaces with a singular space
If you wan to do it on the client side you can still use the same regex but do it on JavaScript and fire it on the onBlur event