Jump to content

String Question


Maurize

Recommended Posts

Posted

If you want remove '+' from string. You can use string.gsub

local s = '2 + 2' 
local s = s:gsub( '+', '' ) 
print( s ) -- 2 2 
  

You mean this?

Posted
If you want remove '+' from string. You can use string.gsub
local s = '2 + 2' 
local s = s:gsub( '+', '' ) 
print( s ) -- 2 2 
  

You mean this?

he want to make :

from : '2 + 2'

to : 2 + 2

something like un-string

Posted

Okay. You can load this via function loadstring.

  
loadstring( 'n = 2 + 2' )( ) 
print( n ) -- 4 
  

You can't get operator '+' from string.

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