Jump to content




string removeal

help lua api

1 reply to this topic

#1 joshuachris

  • Members
  • 6 posts

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

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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( "/", "") )






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users