|
| 23 Jul 2012 11:35 AM |
I can't remember how to get rid of the tuple at the end of gsub
print(string.gsub("O hi my name is psaces", "%s", ""))
I don't want it to print "5" at the end. I forgot.. Any help? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 11:36 AM |
| Use another function then? Or make a table, remove the "5", then use unpack() on it? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 11:36 AM |
| There is way, I have done it before :( |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 23 Jul 2012 11:37 AM |
| Same thing with what electric said. But you can use tabl.concat too if you wanted... |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 11:37 AM |
| You could always use variables to take only 1 of the returned values... |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 11:43 AM |
Nvm, I have it:
msg = ("p l e a s e d o n t r e m o v e m y s p a c e s!!!!") msg = msg:gsub("%s","") print(msg)
Just if you want to know for future ref. |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 12:27 PM |
| I don't usually use gsub... :P |
|
|
| Report Abuse |
|
|