Scooby Posted March 1, 2015 Posted March 1, 2015 Hi, could anyone tell me what i need to do to remove non alphabetical characters from a string? im writing a script to check the chat players use against a dictionary, i would like to be able to remove the non alphabetical characters so i can compare them with my stored word strings. eg: if i have the words: 'how are you?' i dont want to have to add a question mark to every stored word, so i want to remove these characters before i do the check. basically i need to change the string "you?" into "you" and so on for non alphabetical characters. maybe this could be done using string.gsub? i thought i would ask here because ive never used gsub before other than removing colour codes and im sure someone could help me quicker than me trying to work it out [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
Dealman Posted March 1, 2015 Posted March 1, 2015 I'd use gsub, you can find the patterns/regular expressions here. Just have gsub remove the unwanted characters the exact same way you do with colour codes If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
Scooby Posted March 1, 2015 Author Posted March 1, 2015 ok i'll try it. thanks. [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
Et-win Posted March 1, 2015 Posted March 1, 2015 Also here: http://www.lua.org/pil/20.2.html ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Scooby Posted March 2, 2015 Author Posted March 2, 2015 thanks guys, I managed to get it working using %A [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now