kentyler
04-25-2003, 06:21 AM
even odder, lastIndexOf() seems to respect the "start" parameter, but to not work correctly if there is no start parameter
<canvas debug="true">
<script>
<![CDATA[
x = new string("now is the time"); // returns a string object
debug.write( x.lastIndexOf("i") + " is the last postion of 'i' in the string " + x );
// returns 12, should return 2
debug.write( x.lastIndexOf("i", 6) + " is the last postion of 'i' in the string " + x + " if we start looking from the 2nd postion" );
// returns 4
]]>
</script>
</canvas>
<canvas debug="true">
<script>
<![CDATA[
x = new string("now is the time"); // returns a string object
debug.write( x.lastIndexOf("i") + " is the last postion of 'i' in the string " + x );
// returns 12, should return 2
debug.write( x.lastIndexOf("i", 6) + " is the last postion of 'i' in the string " + x + " if we start looking from the 2nd postion" );
// returns 4
]]>
</script>
</canvas>