Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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.
    */

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #slice #character #javascript
ADD COMMENT
Topic
Name
5+8 =