Skip to content

Commit 477535c

Browse files
committed
Add 1.3 URLify solution
1 parent 9a3eb93 commit 477535c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Write a method to replace all spaces within a string with '%20'
2+
3+
const URLify = (string) => string.split(' ').join('%20');
4+
5+
// Tests:
6+
console.log(URLify('Hello World') === 'Hello%20World');
7+
console.log(URLify('') === '');
8+
console.log(URLify('This is an example') === 'This%20is%20an%20example');

0 commit comments

Comments
 (0)