Remove spaces between words in ASP.NET!!!
Questions:
1. How do i remove spaces between works inside the TextBox?
2. How do i remove spaces between works?
3. How to remove spaces in between numbers in asp.net?
4. How do i remove blank spaces between words?
5. How do I remove all symbols (for example "\") from a text string?
Answer:
using System.Text.RegularExpressions;
RegexOptions options =RegexOptions.None;
Regex regex= new Regex(@"[ ]{2,}", options);
TextBox1.Text = regex.Replace(TextBox1.Text,@" ");
TextBox1.Text = Regex.Replace(TextBox1.Text, "[^A-Za-z0-9]", "");
TextBox1.Text = TextBox1.Text.Trim();