Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I dont know what is string.len useful for (?)

Asked by
phxtn 154
6 years ago
Edited 6 years ago

Hello people. Iv'e been reading the scripting book on Roblox Wiki and came across a new thing that I didn't know before: string.len

string.len returns how much a characters a variable has.

HeyDude = "Hey Dude, Wassup!"
print(string.len(HeyDude))

I wanted to know what is useful about it? What can I use it for.

Also I wanted to know what these are useful for as well:

string.lower

string.upper

-PhotonLightning

2 answers

Log in to vote
2
Answered by 6 years ago
Edited 6 years ago
string.len("Hey Dude, Wassup!") --> 17

string.lower("Hey Dude, Wassup!") --> hey dude, wassup!

string.upper("Hey Dude, Wassup!") --> HEY DUDE, WASSUP!
Ad
Log in to vote
0
Answered by 6 years ago

It can be useful if you want to put a character limit into a custom chat function. string.lower returns all characters of the string in lower case, and the same goes for string.upper, except it returns them in upper case. This could be useful if you are trying to scan for certain words, such as swear words, but don't want to worry about the characterisation. Hope this helped :)

Answer this question