![]() public String replace(char oldChar, char newChar) This method accepts the oldChar and newChar, then replaces all the oldChar in the given string literal with the newChar and returns a resultant String object. There are two overloaded methods available in Java for replace(): String.replace() with Character, and String.replace() with CharSequence. String.replace() is used to replace all occurrences of a specific character or substring in a given String object without using regex. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |