generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do i remove the quotes of a string via script?

Previous Thread :: Next Thread 
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 07:13 AM
example: local operation = "1+1" print(operation) ### ##### does not print 2. How do i remove quotes(via script?) siggy
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 07:14 AM
oh why roblox fix your tags


siggy
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 07:14 AM
oh why roblox fix your tags


siggy


siggy
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 07:14 AM
ouch i duplicated my post ;-;


siggy
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 07:15 AM
example: local operation = "1+1" print(operation)
Output: 1 + 1
How do i remove quotes via script?


siggy
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 07:20 AM
local pos = string.find(operation,'"') local pos2 = string.find(operation,'"',pos+1) local finalstring = ###############################
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 07:20 AM
local p = string.find(operation,'"')
local p2 = string.find(operation,'"',pos+1)

local string = string.sub( operation , p , p2)
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 07:22 AM
'"' = a double quote surrounded by single quotes
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 07:24 AM
ok ignore that other one do


local operation = '"1+1"'
local p = string.find(operation,'"')
local p2 = string.find(operation,'"',p+1)

local tring = string.sub( operation , p+1 , p2-1)
print(tring)
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 07:26 AM
just use loadstring ffs
Report Abuse
Customality is not online. Customality
Joined: 11 Aug 2015
Total Posts: 590
12 Mar 2017 08:16 AM
print(1+1) no problem
Report Abuse
DeltaNedas is not online. DeltaNedas
Joined: 10 Sep 2016
Total Posts: 53
12 Mar 2017 08:57 AM
local operation = 1+1 --no "" unless you want a string. print(operation) --> 2 (no "" means it is a numerical operation, not a string like "hi") -< A L L T H E C U # # # # # # S A R E D Y I N G >-
Report Abuse
DeltaNedas is not online. DeltaNedas
Joined: 10 Sep 2016
Total Posts: 53
12 Mar 2017 08:58 AM
lol "stomer" is a bad word.
thanks roblox
Report Abuse
DeltaNedas is not online. DeltaNedas
Joined: 10 Sep 2016
Total Posts: 53
12 Mar 2017 08:59 AM
local operation = 1+1 --not a string, is a numbervalue
print(operation) --> 2
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 09:09 AM
I actually said "via script"


siggy
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 09:16 AM
OMG... the whole time i realised its tonumber then i do more string.sub()


siggy
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
12 Mar 2017 09:21 AM
Well, "tonumber("1 + 1")" will return nil. It just converts the argument to a number.
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 09:22 AM
ROBLOX, please add tosymbol.


siggy
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 09:24 AM
oml just use loadstrings
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 09:24 AM
Example of loadstring? I never use loadstring and i need to get used to it


siggy
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
12 Mar 2017 09:25 AM
bump(forgive me)


siggy
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
12 Mar 2017 12:10 PM
local operation = "1+1"
local b = 0
loadstring("b = " .. operation)
print(b)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Mar 2017 03:01 PM
That wouldn't even work at all. Your funny if you think the function returned to loadstring can see b as an upvalue.

Also
local b = loadstring("return " .. operation)()

is enough
Report Abuse
galio13 is not online. galio13
Joined: 20 Jul 2011
Total Posts: 842
12 Mar 2017 03:15 PM
tostring()
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
12 Mar 2017 03:19 PM
local output = 0

for n in operation:gmatch('%d+')
output = output + tonumber(n)
end

print(output)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image