VOOZH about

URL: https://www.geeksforgeeks.org/scala/scala-string-replaceall-method-with-example/

⇱ Scala String replaceAll() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala String replaceAll() method with example

Last Updated : 3 Oct, 2019
The replaceAll() method is used to replace each of the stated sub-string of the string which matches the regular expression with the string we supply in the argument list.
Method Definition: String replaceAll(String regex, String replacement) Return Type: It returns the stated string after replacing the stated sub-string with the string we provide.
Example #1:
Output:
##Nidhi##
Example #2:
Output:
##Nidhi##Singh
Comment
Article Tags:

Explore