Skip to content

Instantly share code, notes, and snippets.

@lienista
Last active August 28, 2018 07:36
Show Gist options
  • Select an option

  • Save lienista/d430f45526494f8b8719f6d920a4d99f to your computer and use it in GitHub Desktop.

Select an option

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
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