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: Help with Gsub string

Previous Thread :: Next Thread 
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
20 Jun 2013 05:31 PM
D = "18/8/2007"

Dfix = string.gsub(Date, "8", "08", 1)

I only want it to sub the 2nd 8, how do i do that?
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
20 Jun 2013 05:42 PM
:I
Report Abuse
Tenal is not online. Tenal
Joined: 15 May 2011
Total Posts: 18684
20 Jun 2013 05:46 PM
Dfix = string.gsub(Date, "8", "08", 3)
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
20 Jun 2013 05:47 PM
it no work like that

the last number is the amount of times it replaces 8 with 08
Report Abuse
ShoeBox4 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
20 Jun 2013 05:47 PM
Excuse if I am wrong, but I believe you need to change your variable name. Just change "D" to "Date". The variables don't match, therefore it won't enter in "18/8/2007".
Report Abuse
ColdSmoke is not online. ColdSmoke
Joined: 02 Jan 2012
Total Posts: 5784
20 Jun 2013 05:53 PM
oops I changed that just before I posted it

in actual script they match
Report Abuse
xSIXx is not online. xSIXx
Joined: 06 Aug 2010
Total Posts: 9202
20 Jun 2013 05:55 PM
D = "18/8/2007"

Dfix = string.gsub(D, "/8", "/08", 1)

durr hurr hurr
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