Skip to content

Commit d81bc26

Browse files
authoredMay 31, 2021
feat: add typescript solution to locf problem: No.05. Replace Space (doocs#423)
1 parent 8c79c7b commit d81bc26

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎lcof/面试题05. 替换空格/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ public:
127127
};
128128
```
129129
130+
### **TypeScript**
131+
132+
```ts
133+
function replaceSpace(s: string): string {
134+
return s.replace(/\s/g, '%20');
135+
};
136+
```
137+
130138
### **...**
131139

132140
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function replaceSpace(s: string): string {
2+
return s.replace(/\s/g, '%20');
3+
};

0 commit comments

Comments
 (0)