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: String, help please.

Previous Thread :: Next Thread 
JusticeLym is not online. JusticeLym
Joined: 07 Oct 2011
Total Posts: 261
10 Apr 2013 10:32 AM
How would I make it so it takes a Value, lets say "JusticeLym" and takes out "L"s then returns it to a new value "Justiceym". Any ideas? Something like c/ admin.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
10 Apr 2013 10:37 AM
value = "JusticeLym"
result = ""
for i = 1, #string do
if string.sub(value, i, i) ~= "L" then
result = result..string.sub(value, i, i)
end end


This sets 'result' to be the initial string without any Ls.
Report Abuse
JusticeLym is not online. JusticeLym
Joined: 07 Oct 2011
Total Posts: 261
10 Apr 2013 10:38 AM
Thank you.
Report Abuse
JusticeLym is not online. JusticeLym
Joined: 07 Oct 2011
Total Posts: 261
10 Apr 2013 11:14 AM
Is there a way to add it into a word?
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
10 Apr 2013 11:16 AM
What do you mean?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
10 Apr 2013 11:16 AM
If you know the location of the newly added bit, yes you can.
Also, use newString = oldString:gsub("L", "") to get rid of L's.
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