My main goal was to see if I could combine the two For Loops into one For Loop and get the same results. I only want 0-9 and any other character has to be removed. I'm validating and any key is possible. Maybe not 0 thru 31, but the rest is not wanted and is on a key board for mistakes. Thanks for you comment aikimark.
Main Topics
Browse All Topics





by: aikimarkPosted on 2007-03-22 at 11:24:48ID: 18773570
For i = 0 To 47
MyString = Replace(MyString, Chr(i), "")
Next i
1. Do you really need to concern yourself with characters less than 32?
2. Is cleaner really your problem, or are you experiencing performance problems? Your two loops look pretty clean. You combine these two loops, but wouldn't gain any simplicity or cleanliness.
3. How long are your MyString strings?