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
367
S
217
G
82
Posts: 23,262
Reputation: 183,679

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
27
S
7
G
6
Posts: 22
Reputation: 6,221


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests