I have an if
statement which checks if a variable is equal to some string. But, I want to check if there is an number in the string, too. Something like this:
if(thestring.equals("I, am awesome. And I'm " + Somehowgetifthereisanumberhere + " years old")) {
//Do stuff
}
Or more specifically, where x is the unknown number, just to know there is a number (any number) there:
String str = item.substring(item.indexOf("AaAaA" + x), item.lastIndexOf("I'm cool."));
How to do that?