I need to remove spaces from the end of a string. How can I do that? Example: if string is \"Hello \" it must become \"Hello\"
\"Hello \"
\"Hello\"
In Swift
To trim space & newline from both side of the String:
var url: String = "\n http://example.com/xyz.mp4 " var trimmedUrl: String = url.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())