How To Replace A Character In A String In Scala

[Solved] How To Replace A Character In A String In Scala | Swift - Code Explorer | yomemimo.com
Question : how to replace a character in a string in scala

Answered by : zac

// Scala program of replace()
// method
  
// Creating object
object GfG
{  
    
// Main method
def main(args:Array[String])
{
  
// Applying replace method
val result = "Nidhi".replace('N', 'n')
    
// Displays output
println(result)
   
   }
}

Source : https://www.geeksforgeeks.org/scala-string-replace-method-with-example/ | Last Update : Sun, 06 Mar 22

Answers related to how to replace a character in a string in scala

Code Explorer Popular Question For Swift