tokenCount of empty string returns 1

Bugs will be moved here once resolved.

Post » Wed Jan 11, 2012 5:01 pm

I've encoutnered that:
tokenCount("",",") = tokenCount("foo",",")= 1

Is this really correct result for this expression?

I would think an empty string should have 0 tokens.
B
28
S
5
G
1
Posts: 30
Reputation: 1,889

Post » Wed Jan 11, 2012 6:42 pm

Oops, good find, will fix for next build.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Apr 24, 2012 6:01 pm

TokenCount returns 1 more than the number of tokens in a string. If there are no tokens, it returns 1. I guess this is related to this closed bug. I am on C2 Beta R87 64 bit. Capx for testing is attached.
http://db.tt/zuwMFZb0
Checkout my tutorial on smooth swipe with inertia.
Play the game jam winning game Kontrazt
B
30
S
9
G
6
Posts: 29
Reputation: 6,665


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests