JJooeeyy Posted March 26, 2013 Share Posted March 26, 2013 Hey guys, i made a script, that saves strings that players wrote into a memo into a SQL Database. i use the one that gets provided by mta, no addons. now if there is a ' inside the string, it will output a debug and not save anything. any ideas how to escape, or, if not possible, remove all ' (and other characters that make this not work) out of a string? and if thats possible, could someone tell me which letters i have to take out? Thank you very much JJooeeyy Link to comment
MIKI785 Posted March 26, 2013 Share Posted March 26, 2013 This will remove any '. string.gsub(stringToClear, "'", "") Is that what you want? Link to comment
JJooeeyy Posted March 26, 2013 Author Share Posted March 26, 2013 AWESOME, thx!!! Now i just need to know what other letters will cause problems can i clear more then just 1 letter with i command? For excample taking out all / and ( ? EDIT: Nevermind, just found out by myself I'm gonna build a function : function clearString (dirtystring) clearedString = string.gsub(dirtystring, "'", "") return clearedString end and send every string to it i need to get cleared so i can take out more letters if i want Link to comment
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