/**
* Gets the index of the first digit in a string or -1.
*
*/
public static int getFirstDigit(String text) {
if (text != null) {
for (int i = 0; i < text.length(); i++) {
if (Character.isDigit(text.charAt(i))) {
return i;
}
}
}
return -1;
}