Yeah in Swift 5 the syntax is pretty similar
string.replaceOccurrences(of: “ “, with: “%20”)
In everyday practice, I def use that method.
Typically in interviews, interviewers want to see whether the interviewee understands/can derive the algorithm which makes that method work (hence, all the code 😬🙃)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Uhhh...
Or if you wanna go all in:
(Snippets are in Python because I don’t know Swift)
Yeah in Swift 5 the syntax is pretty similar
string.replaceOccurrences(of: “ “, with: “%20”)
In everyday practice, I def use that method.
Typically in interviews, interviewers want to see whether the interviewee understands/can derive the algorithm which makes that method work (hence, all the code 😬🙃)