[Solved] Scala: How to replace all consecutive underscore with a single space?
You could use replaceAll to do the job without regex : val name: String = “cust_id” val newName: String = name.replaceAll(“_”,” “) println(newName) solved Scala: How to replace all consecutive underscore with a single space?