What the meaning of len expression on Text plugin?

Just started using Construct 2? Post your questions here

Post » Tue Nov 17, 2015 11:29 am

Hello,

I've read this manual https://www.scirra.com/manual/126/system-expressions
and search the meaning of len, but i still didnt get the meaning of.

it says like this,
len(text)
Return the number of characters in text.


Could anyone describe it to me, please?

Thanks very much :mrgreen:
~Everyone can make GAMEs~
B
55
S
11
G
1
Posts: 414
Reputation: 5,786

Post » Tue Nov 17, 2015 11:31 am

len("hello") = the number of characters (letters including spaces) in text = 5

so len("text plugin") = 11
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Tue Nov 17, 2015 11:37 am

Hardty wrote:Hello,

I've read this manual https://www.scirra.com/manual/126/system-expressions
and search the meaning of len, but i still didnt get the meaning of.

it says like this,
len(text)
Return the number of characters in text.


Could anyone describe it to me, please?

Thanks very much :mrgreen:


Hard to explain further. It counts the number of individual characters, e.g.

Different example using a variable to RamPackWobble.

If you had a variable called 'howmany' that had a text string of "countme", then
Code: Select all

len(howmany) would return 7
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,390
Reputation: 58,462

Post » Tue Nov 17, 2015 11:41 am

hoo.. alright guys! Thank you for your helps :D
now i'm understand with this :mrgreen:
~Everyone can make GAMEs~
B
55
S
11
G
1
Posts: 414
Reputation: 5,786


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests