📅  最后修改于: 2022-03-11 15:03:34.277000             🧑  作者: Mango
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.
*/
}