Ansal Antony Ansal Antony - 6 months ago 18
Swift Question

How can I remove quotes from String on Swift?

I am trying to remove quotes from Swift

String
something like:

"Hello"

so that the Swift
String
is just:

Hello

N J N J
Answer

You can simply use

var str: String = "\"Hello\""


print(str) // "Hello"

print(str.stringByReplacingOccurrencesOfString("\"", withString: "")) // Hello