Answers for "slice until character javascript"

1

slice until character javascript

var string = "55+5"; // Just a variable for your input.

function getBeforePlus(str){

    return str.split("+")[0]; 
    /* This splits the string into an array using the "+" 
       character as a delimiter.
       Then it gets the first element of the split string.
    */

}
Posted by: Guest on July-13-2021

Code answers related to "slice until character javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language