Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- type
- custom hook
- IBM
- react
- Debug
- TABLESPACE
- codewar
- react hook
- isSquare
- JDBC
- TypeScript
- codewars
- descendingOrder
- manifest.json
- useEffect
- DB2
- java api
Archives
- Today
- Total
taesik
Backspaces in string 본문
Assume "#" is like a backspace in string. This means that string "a#bc#d" actually is "bd"
Your task is to process a string with "#" symbols.
export function cleanString(s: string) {
return Array.from(s).reduce((a, b) => b == '#'? a.slice(0,-1) : a.concat(b), '')
}
'functions and trick > typescript_javascript' 카테고리의 다른 글
| retrun true if every value in the array has its corresponding value squared in the secone array. (0) | 2022.04.29 |
|---|---|
| Counting Duplicates (0) | 2022.01.29 |
| Consecutive strings (0) | 2022.01.29 |
| digitRoot (0) | 2022.01.29 |
| Coordinates Validator (0) | 2022.01.28 |