Different results of slice <string> <from> <to>
with too large <to>
#1282
Unanswered
programandala-net
asked this question in
Q&A
Replies: 1 comment
-
Yes, it's a bug! As you can see, the highest possible index in this case is 3. Both, 4 and 5 are out-of bound indexes, so this should be illegal. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Why
slice "0123" 2 4
andslice "0123" 2 5
give different results?:In both cases the third parameter is beyond the last index. Therefore I expected the same result: the final part or the string ("23") or an empty string (which is what
slice "0123" 2 5
returns), ornull
, or even an error.Is it a bug or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions