I have strings with values "Address Line1", "Address Line2" ... etc. I want to add a space if there is any numeric value in the string like "Address Line 1", "Address Line 2".
I can do this using contains and replace like this
String sample = "Address Line1";
if (sample.contains("1")) {
sample = sample.replace("1"," 1");
}
But how can I do this using regex?