Below code is giving me expected result "1524587" but right side could be -0
, -1
etc , so how to grab left side string before -
? my 2nd option is not returning the left string
main.js
const str = "1524587-0";
// 1st option
const rxNumber = element.str .replace('-0', '');
// 2nd Option
const splitstring = str.split('-')