
Originally Posted by
jmcilhinney
You would use a regular expression for this. I'm far from an expert with regular expressions so I usually give them a miss but this seemed like a rather easy one so I figured I'd give it a go. This worked for me in my one simple test:
vb.net Code:
RichTextBox1.Text = Regex.Replace(RichTextBox1.Text,
"\d-\d-\d",
String.Empty)
The "\d" in the pattern stands for any numeric digit.
Only thing is the Regex? It says it's not declared. What is it?
Edit: It also doesn't work because it takes your
Code:
Replace(RichTextBox1.Text, "\d-\d-\d",
Literaly and if you type \d-\d-\d then it will empty the string, but numbers will not work.