Answers for "javascript split multiple values"

0

javascript split multiple values

function splitMulti(str, tokens){
        var tempChar = tokens[0]; // We can use the first token as a temporary join character
        for(var i = 1; i < tokens.length; i++){
            str = str.split(tokens[i]).join(tempChar);
        }
        str = str.split(tempChar);
        return str;
}
Posted by: Guest on March-09-2021

Code answers related to "javascript split multiple values"

Code answers related to "Javascript"

Browse Popular Code Answers by Language