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: Breaking up a string?

Previous Thread :: Next Thread 
haloisabeast is not online. haloisabeast
Joined: 28 Jun 2009
Total Posts: 366
02 May 2012 07:13 PM
is it possible to break up a string into each of its characters?
for example, of i have "hello world!", could i do something that would give me all separate strings like "h" "e" "l" "l" "o" " " "w" "o" "r" "l" "d" "!" ?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
02 May 2012 07:24 PM
function getChars(String)
    local chars = {}
    for i = 1, String:len() do
        table.insert(chars, String:sub(i, i))
    end
    return chars
end

local charList = getChars("Hello, world!")
print( type(charList) )
Report Abuse
haloisabeast is not online. haloisabeast
Joined: 28 Jun 2009
Total Posts: 366
02 May 2012 07:37 PM
thanks! with a little bit of editing i got it to do what I wanted it to do! what i am doing (if ur interested) is having a sentence type out on the players screen, but i wanted it to look like it was being typed. Awesome!
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
02 May 2012 08:04 PM
:O
AgentFirefox, your at your exact 17000'th post!!!

What exactness...
With a Five-Guys burger in my hands, I am now invincible!
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