Skip to content

Commit 60c1518

Browse files
committed
Handle multiple spaces in case conversion
1 parent dc6b184 commit 60c1518

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Sprint-3/3-mandatory-implement/2-cases.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Use the MDN string documentation to help you find a solution
1616
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
1717
function toUpperSnakeCase(words) {
18-
return words.toUpperCase().replaceAll(" ", "_");
18+
return words.toUpperCase().trim().split(/\s+/).join("_");
1919
}
2020

2121
console.log(toUpperSnakeCase("hello there"));

0 commit comments

Comments
 (0)