We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afc0084 commit 4cf9bebCopy full SHA for 4cf9beb
chapter01/1.3 - URLify/urlify-2.js
@@ -0,0 +1,11 @@
1
+const replaceUrlSpaces = (str) => {
2
+ const convertToArray = str.trim().split('');
3
+ for(let i in convertToArray) {
4
+ if(convertToArray[i] === " ") {
5
+ convertToArray[i] = "%20"
6
+ }
7
8
+ return convertToArray.join('');
9
+}
10
+
11
+ console.log(replaceUrlSpaces("Sai Charan P"));
0 commit comments