Add integer suffix

This commit is contained in:
Victor Shcherb 2016-02-21 19:21:18 +01:00
parent 740fd102e1
commit af5253b8b0

View file

@ -280,6 +280,16 @@ public class Algorithms {
return ""; return "";
} }
public static String extractOnlyIntegerSuffix(String s) {
int k = 0;
for (; k < s.length(); k++) {
if (Character.isDigit(s.charAt(k))) {
return s.substring(k);
}
}
return "";
}
public static String extractIntegerSuffix(String s) { public static String extractIntegerSuffix(String s) {
int k = 0; int k = 0;
for (; k < s.length(); k++) { for (; k < s.length(); k++) {