I have the following number: 43215 putted in a textField. and i got that number with the following instruction:
String cardNumber = jTextFieldCardNumber.getText();
I got a string value, how could I do to get the first number of that string?
the output should be : "4".
cardNumber.substring(0, 1)
String#charAt()
orString#substring
Both are documented in the JavaDocs for the Java API.