2016-02-05 40 views
-1

問::如何從我的字符串URL我應該如何從我的字符串URL刪除+(SWIFT)

問題,請刪除+ ::在調用API我得到+符號在網址的結尾這樣我怎麼能刪除+

這裏是我的代碼

extension String { 
    func encodeURL() -> String { 
    return self.stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())! 

    } 
} 

回答

2

如果你想擺脫任何出現的這消除空間「+」,你可以使用這個

​​
相關問題