Answers for "java get number at the end of string"

0

java get number at the end of string

public static BigInteger lastBigInteger(String s) {
    int i = s.length();
    while (i > 0 && Character.isDigit(s.charAt(i - 1))) {
        i--;
    }
    return new BigInteger(s.substring(i));
}
Posted by: Guest on November-25-2020

Code answers related to "java get number at the end of string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language