ilnaz Posted May 17, 2020 Share Posted May 17, 2020 How replace this symbol "\" ? local text = 'aaa\bbb' text = text:gsub('\\','') -- don't work text = text:gsub('%\\','') -- don't work text = text:gsub('\','') -- don't work and an error in debugscript text = text:gsub('%\','') -- don't work and an error in debugscript Link to comment
Moderators Patrick Posted May 17, 2020 Moderators Share Posted May 17, 2020 text = text:gsub('\\','') -- don't work probably this is the good one, but your debug tests are wrong, because: local text = 'aaa\bbb' In this string \ is not a character, I mean its not a simple backslash. Because its "interact" with the next b. So \b this two character is "one" special character. Link to comment
KronoS Lettify Posted May 17, 2020 Share Posted May 17, 2020 I've tried it, and worked: text = 'aaa\bbb' print(text) text2 = text:gsub('\b', 'b') print(text2) 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