Computer Science, asked by tariquesufiya, 1 day ago

how can you replace any string? explain with example​

Answers

Answered by vineethav093
1

Answer:

. String replace() : This method returns a new string resulting from replacing all occurrences of old characters in the string with new characters. Syntax: public String replace(char oldch, char newch) Parameters: oldch : the old character. newch : the new character.

i hope u understand

Answered by Saran2021cool
1

Answer:

Explanation:

replaceAll() The replaceAll() method returns a new string with all matches of a pattern replaced by a replacement . The pattern can be a string or a RegExp , and the replacement can be a string or a function to be called for each match. The original string is left unchanged.

Similar questions