NekoManu Posted November 8, 2004 Posted November 8, 2004 I have a string and I want to remove anything that is not a letter. I know I can use the replace method, but then I have to check for everything. I hope there is a better way of doing this. Quote
mocella Posted November 8, 2004 Posted November 8, 2004 Check out MSDN on "Regex.Replace()". Looks like their sample does a reimplementation of ToUpper(), but you can slightly modify that code in CapText() to return an empty string. Quote
NekoManu Posted November 8, 2004 Author Posted November 8, 2004 Thanks I seems to work. Here is how to get rid of anything that is not a letter: Regex.Replace(InString, @"[^a-zA-Z]", "") Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.