THE TEAL PICKLE CODING CHALLENGE!! Replace all spaces on a string with ‘%20'. I solved this problem with my lover, Swift. TRY IT 👀
![Cover image for [Swift CODE] URLify](https://res.cloudinary.com/practicaldev/image/fetch/s--VwXdGB6b--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/tm540dsurl8m7xe9tykv.png)
For further actions, you may consider blocking this person and/or reporting abuse
For further actions, you may consider blocking this person and/or reporting abuse
Ebikara Dandeson Spiff -
OpenSource -
Agbo, Daniel Onuoha -
Srijan Karki -
Top comments (2)
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 😬🙃)