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: strings

Previous Thread :: Next Thread 
BetaGrey361 is not online. BetaGrey361
Joined: 27 Jun 2014
Total Posts: 118
25 Aug 2014 09:53 AM
Is there a way to get a number value of how many characters are in a string?
Report Abuse
jaredmai is not online. jaredmai
Joined: 08 Sep 2011
Total Posts: 395
25 Aug 2014 10:09 AM
Not that I know of.
Report Abuse
BetaGrey361 is not online. BetaGrey361
Joined: 27 Jun 2014
Total Posts: 118
25 Aug 2014 10:14 AM
How would I go about getting a "Typewriter" effect if I wanted to print something? But it has to change, because not everyone's playername is the same.
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
25 Aug 2014 10:16 AM
#('String')
string.len'String'
('String'):len()

If you want specifically how many LETTERS there are

local tab = {}
for letter in gmatch('%a','letters') do
table.insert(tab, letter)
end

#tab is the amount of letters.
Report Abuse
BetaGrey361 is not online. BetaGrey361
Joined: 27 Jun 2014
Total Posts: 118
25 Aug 2014 11:23 AM
#('String')
string.len'String'
('String'):len()

What does that do? Can you dissect that for me?
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
25 Aug 2014 11:29 AM
Strings are really similar to tables (maybe hard-coded as a list or something) so you can grab the length of a string with the length operator (#)

print(#('hello'))

-- Note, you can index strings if common sense didn't tell you that you could.


string.len is a function that gets length of strings.

print(string.len'hello')

('haidere'):len() is a bit different that all strings have an index that refers to "len" function like in string.len. Calling it like a method automatically makes the first argument itself which enacts like the previous example.

print(('haidere'):len())

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