I am working on an application which at some point, needs to automatically read an ID number of the type “X00001”. It comes in a string from a sql database, but my program only needs the “00001” part.
How can I use the String.split() method (or any other method) to get rid of the letters in the code?
Note there is only one note letter per code, so eliminating the first character of the code would be enough for me. I have thought of converting the string to a char[] array, and then extract from it only the other characters, but I thought it was a nice idea to learn how to use the split() Method.
This really isn’t a job for split. If you know you’re taking off the first character of the string, use Substring.