Closed GoogleCodeExporter closed 9 years ago
The above happens when "first occurrence" is selected.
If "last occurrence" selected, it returns string.length+1.
Original comment by azoun...@gmail.com
on 11 May 2013 at 6:44
That's expected. Try the following in JS:
"abc".indexOf("")
or Python:
"abc".find("")
Both return 0 (match on first character), not -1 (no match).
Blockly is a one-based language (like Lua or LambdaMOO), so the first character
is 1. Thus it is correct.
Original comment by neil.fra...@gmail.com
on 20 May 2013 at 6:38
You are perfectly correct as a programmer, but it feels a bit strange to teach
that "nothing matches anything"...
Original comment by azoun...@gmail.com
on 20 May 2013 at 10:16
Original issue reported on code.google.com by
azoun...@gmail.com
on 11 May 2013 at 6:40