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 » Scripting Helpers
Home Search
 

Re: Two questions...

Previous Thread :: Next Thread 
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
02 Feb 2013 10:09 PM
Does -e work in RBX.Lua?
And
What is :gsub()?
I've noticed that :gsub() gets crazy with symbols.

~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
02 Feb 2013 10:13 PM
I think gsub switches parts of a string.

print(string.gsub("I like pie", "like", "hate"))

>I hate pie
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Feb 2013 10:20 PM
^

You can also do

s = "I like pie"

print(string.match(s,"%u").." hate"..string.sub(s,s:len() - 3,s:len()))

Many ways to substitute. But point is gsub is the most efficient and has best performance in this situation.

Report Abuse
UnAdmin is not online. UnAdmin
Joined: 10 Jul 2012
Total Posts: 4706
02 Feb 2013 10:40 PM
Why do people add all those fancy characters?

~ᴬᴵᴺ'ᵀ ᵀᴴᴬᵀ ᴬ ᴷᴵᶜᴷ ᴵᴺ ᵀᴴᴱ ᴴᴱᴬᴰˑ~
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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