更新时间:2023-02-19 23:27:48
一个选项:在 Map
上使用 foldLeft
和 str
作为初始参数:
One option: use foldLeft
on the Map
with str
as the initial parameter:
replacements.foldLeft(str)((a, b) => a.replaceAllLiterally(b._1, b._2))
// res8: String = This d is very x and I would love to mxc