I want to extract Number
s from a string, example message is like this
Hello Your Account NO 295093491783 is been deducted by 17820.if you did not receive the Ack call 9897123456.
Right now i am using Google's Guava Like this
String temp = CharMatcher.JAVA_DIGIT.retainFrom(message);
for which I am getting the result like 295093491783178209897123456 and my desired format is
String[] a = {"295093491783", "17820", "9897123456"}
Any help would be appreciated. I Wanted to do this using the guava library.
Note:-
I don't want to use regex because
CharMatcher
is faster than regex.My current solution is almost running at 6000 tps (Transactions Per Second).