Jump to content

HOW REPLACE SYMBOL \


ilnaz

Recommended Posts

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

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...