This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
joshuachris's profile picture

string removeal

Started by joshuachris, 19 November 2016 - 09:15 PM
joshuachris #1
Posted 19 November 2016 - 10:15 PM
i need help i need a way to remove / and \ if there entered in with read()
it is giving me errors
Bomb Bloke #2
Posted 20 November 2016 - 02:09 AM
Remember that '\' is an escape character; if you want to refer to it as a "regular" character within your own code, you'll want to refer to it as '\\'.

With that said, gsub can do this:

print( read():gsub( "\\", "" ):gsub( "/", "") )