i know how to replacing characters but when i try to replacing this characters \ and " gives me error is there any way to do. thanks
\ and " are from keyboard but i want replacing because i am using in URL and this URL don't read this.
when i click in character \ or " In keyboard xcode give me error
code:
// I want make some like termClean1
@IBOutlet weak var SearchBar: UISearchBar!
var term: String = "" {
didSet {
let termClean1 = term.replacingOccurrences(of: "\", with: "+")
print(" \(term)")
print("\(termClean1)")
}
}
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
self.term = searchBar.text!
}