0 votes
by (360 points)
Hi ( ^_^)/

At the begining of the game, I am having the players to input their name into $name

At some point I want to refer to the number of letters their name has, but I wasn't sure how I go about and do it

Any ideas?

1 Answer

+1 vote
by (159k points)
selected by
Best answer

The 'name' in the $name variable will be a String value, as explained in the linked documentation you can use that data-type's length property to determine how many characters are in the value.

(set: $name to "Jane Doe")

your name is $name, which has (print: $name's length) characters (including the space)


by (360 points)
Yes, Thats what I was looking for, Thank you very much (^_^)/