Is it possible to take a piece of a string, and get the length of a string?
I know they have that for the TI-84 plus.
Can you give me the syntax, or at least where to find it?
RECAP: Can I take a piece of a string and find the length of it?
3 replies to this topic
#1
Posted 08 April 2012 - 01:49 AM
#2
Posted 08 April 2012 - 01:53 AM
You can use string.sub to get substrings, and string.len or the lenght operator (#).
local s = string.sub(your_string, pos1, pos2)
print("The substring is: ", s)
print("It's lenght is: ", #s)
Check out this link for more lua string functions: StringLibraryTutorial
#3
Posted 08 April 2012 - 02:02 AM
Length usage:
string = "cabbage" return string:len() > returns 7
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











