File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Sprint-2/3-mandatory-implement Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1414// You will need to come up with an appropriate name for the function
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
17+
18+ function convertToUpperSnakeCase ( inputString ) {
19+ // we need to find everywhere the character space is and replace it with an underscore
20+ // we need to convert the string from lowercase to uppercase
21+ const oldCharacterSpace = " " ;
22+ const newCharacterUnderscore = "_" ;
23+ const findspaceAndReplace = inputString . replaceAll ( oldCharacterSpace , newCharacterUnderscore ) ;
24+ const convertToUpperCase = findspaceAndReplace . toUpperCase ( ) ;
25+ return convertToUpperCase ;
26+ }
27+
28+ const actualOutput = convertToUpperSnakeCase ( "how are you Tolu" ) ;
29+ console . log ( actualOutput ) ;
You can’t perform that action at this time.
0 commit comments