Java string replace using regex -



Java string replace using regex -

i have strings values "address line1", "address line2" ... etc. want add together space if there numeric value in string "address line 1", "address line 2".

i can using contains , replace this

string sample = "address line1"; if (sample.contains("1")) { sample = sample.replace("1"," 1"); }

but how can using regex?

sample = sample.replaceall("\\d+"," $0");

java regex

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -