Okay, say I have a string, such as var/mybad = "DinkyDonk"
How can I make sure that the string only contains certain characters, such as A-Z. Can I treat it as a list? Ex, mybad[1] = "D" mybad[2] = "i" etc.?
ID:176525
Jan 5 2003, 9:41 am
|
|
In response to Soori-99
|
|
Yes, I took a look at that... but no. I need to filter valid characters, instead of invalid. I've found a method, and I'm writing code right now. Using the copytext to copy it letter by letter to a list... then I can individually check it... I've got it all in my head, lol. Wonder how many Errors I'll get.
[Edit] HOORAY! It works perfectly... I'm testing in a verb right now, here it is, try it if you want: Test() As you see, the character "!" is not on the valid character list, and is stripped. That ought to keep characters like ~ or Å away! |
You can look for characters that you don't want in there such as numbers or dashes. You can put them in a list like so:
Then Check if a text string contains any of those characters:
Hope ive been helpful.