Java String replaceAll()
The java string replaceAll() method returns a string replacing all the sequence of characters matching regex and replacement string.
regex : regular expression
replacement : replacement sequence of characters
Java String replaceAll() example: replace character
Let's see an example to replace all the occurrences of a single character.Test it Now
jevetpoint is e very good website
Java String replaceAll() example: replace word
Let's see an example to replace all the occurrences of single word or set of words.Test it Now
My name was Khan. My name was Bob. My name was Sonoo.
Java String replaceAll() example: remove white spaces
Let's see an example to remove all the occurrences of white spaces.Test it Now