Jump to content

help replacing characters in a string


Scooby

Recommended Posts

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 :)

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...