KillerX Posted February 1, 2019 Share Posted February 1, 2019 Hi , now i have this string msg = "@#!%%^,:{}" and i can remove all signs from this string by this way string.gsub( msg , '%p' , '' ) tha question is : how to remove all signs from this string except this sign " , " Thanks Link to comment
AncienT Posted February 1, 2019 Share Posted February 1, 2019 patterns = {"%p", ","} for i,v in ipairs(patterns) do str = string.gsub(str, v, "") end 23 minutes ago, KillerX said: Hi , now i have this string msg = "@#!%%^,:{}" and i can remove all signs from this string by this way string.gsub( msg , '%p' , '' ) tha question is : how to remove all signs from this string except this sign " , " Thanks https://stackoverflow.com/questions/25280374/lua-string-gsub-with-multiple-patterns Link to comment
KillerX Posted February 1, 2019 Author Share Posted February 1, 2019 (edited) 11 minutes ago, AncienT said: patterns = {"%p", ","} for i,v in ipairs(patterns) do str = string.gsub(str, v, "") end https://stackoverflow.com/questions/25280374/lua-string-gsub-with-multiple-patterns i've done some tests and i've found the solution msg = "@#!%%^,:{}" outputChatBox( msg:gsub( '[^,]' , '' ) ) thank's anyway Edited February 1, 2019 by KillerX 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