(swift) remove "\" character from string? -
i have string contains few \ , want remove of them. can tell me how can that. have tried stringbyreplacingoccurrencesofstring it's not working out me.
var str = "\\dagdahughuad\\dajughdaug" var str2 = str.stringbyreplacingoccurrencesofstring("\\", withstring: "", options: nsstringcompareoptions.literalsearch, range: nil) print(str2) this output
dagdahughuaddajughdaug
Comments
Post a Comment