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
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

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
B
27
S
6
G
6
Posts: 20
Reputation: 6,132


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests