Skip to content

Commit 44c3567

Browse files
committed
refactor: change location of functions
1 parent d68da8f commit 44c3567

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/utils/string.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export function capitalize(str: string): string {
2+
return str.charAt(0).toUpperCase() + str.slice(1);
3+
}
4+
5+
export function capitalizeAndTrim(str: string): string {
6+
const words = str.split(' ');
7+
let result = "";
8+
for (let word of words) {
9+
result += capitalize(word);
10+
}
11+
return result;
12+
}

0 commit comments

Comments
 (0)