How Do I Convert Pipe Delimited to Comma Delimited with Escaping
Posted
by Russ Bradberry
on Stack Overflow
See other posts from Stack Overflow
or by Russ Bradberry
Published on 2010-04-19T22:27:44Z
Indexed on
2010/04/19
22:53 UTC
Read the original article
Hit count: 348
Hi, I am fairly new to scala and I have the need to convert a string that is pipe delimited to one that is comma delimited, with the values wrapped in quotes and any quotes escaped by "\"
in c# i would probably do this like this
string st = "\"" + oldStr.Replace("\"", "\\\\\"").Replace("|", "\",\"") + "\""
I haven't validated that actually works but that is the basic idea behind what I am trying to do. Is there a way to do this easily in scala?
© Stack Overflow or respective owner