Skip to content

Conversation

@StefanD986
Copy link

line.substring(0,0) results in a zero-length string. As the documentation for String::substring says: "The substring begins at the specified beginIndex and extends to the character at index endIndex - 1.".

So to extract the first character, startindex must be 0 endindex must be 1.

`line.substring(0,0)` results in a zero-length string. As the documentation for `String::substring` says: "The substring begins at the specified beginIndex and extends to the character at index endIndex - 1.".

So to extract the first character, `startindex` must be `0` `endindex` must be `1`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant