(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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -