From af5253b8b0989fcf6abd1f03af260b66f4e1f923 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 21 Feb 2016 19:21:18 +0100 Subject: [PATCH] Add integer suffix --- OsmAnd-java/src/net/osmand/util/Algorithms.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/util/Algorithms.java b/OsmAnd-java/src/net/osmand/util/Algorithms.java index 2dfc8e3500..38018766b3 100644 --- a/OsmAnd-java/src/net/osmand/util/Algorithms.java +++ b/OsmAnd-java/src/net/osmand/util/Algorithms.java @@ -280,6 +280,16 @@ public class Algorithms { 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) { int k = 0; for (; k < s.length(); k++) {