Last active
August 28, 2018 07:36
-
-
Save lienista/d430f45526494f8b8719f6d920a4d99f to your computer and use it in GitHub Desktop.
Algorithms in Javascript: CTCI 1.3 URLify: Write a function to create an URL by replacing all spaces of an URL string with %20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createUrl = (s1) => { | |
| return s1.split(' ').join('%20'); | |
| } | |
| let url = 'javascript algorithms' | |
| console.log(createUrl(url)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment