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