I am working on a program, and I am trying to get rid of unwanted characters so I can put the string to a list. I am trying to get rid of all of the characters except the letters, hyphen, and a space. Any help? I am pretty new to this programming so I need help.
The string-to-list routine doesn't require you to use the exact string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " as your reference string. It's fine if you add more characters to that reference string as long as the reference string is consistent between the string-to-list and list-to-string routines.
If you do want to remove any characters that aren't space, letters, or hyphen, here's some pseudocode:
Concatenate a "?" on each side of Str1 For each character c in Str1, except the first and last: If c is not in the reference string "ABCDEFGHIJKLMNOPQRSTUVWXYZ -": Set Str1 to the substring of Str1 before c, concatenated to the substring after c
That shouldn't be too hard to implement.