var str='The_Andy_Griffith_Show'; // string to perform replace on
var regExp1=/\s|[A-Z]/g;
var regExp2=/[^A-Z]/g; // regular expression
var str2 =str.replace(regExp2,regExp1);
// expected output: The_ Andy_ Griffith_ Show
I want to replace all the first capital letters of a string with a space and that same letter, and if that's not possible is there a workaround?
Thein the expected output?