Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Modify String with Uppercase

function myReplace(str, before, after) {
  if (before[0] === before[0].toUpperCase()) {
    after = after.replace(after[0], after[0].toUpperCase());
  }
  return str.replace(before, after);
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Modify #String #Uppercase
ADD COMMENT
Topic
Name
7+2 =