How can I get the final character in a string for a substring?
From ggc
Can someone help me with the substring command? I am trying to figure out how to include the final character of a string in a substring. For instance, given the string "Hello", we start with H in position 0, and finish with o at position 4... But since the substring command does not include the final character in the parameters, entering a command like sting.substring(0,4) would return "Hell" (rather appropriate, now I think of it) Trying to finagle the code by entering string.substring(0,5) returns a "StringIndexOutOfBoundsException" error.
- This page was last modified on 10 October 2009, at 12:08.
- This page has been accessed 148 times.
- Privacy policy
- About ggc
- Disclaimers
- Powered by MediaWiki!









