javascript - Remove text between ( and ) in js variable -
this question has answer here:
i have got variable: var alma = 'ez itt (alma)';
output ez itt
how can it?
:-) it's substr in php, not need. variable example... have more variables, 100-200 , different lenght.
try this,
var alma = 'ez itt (alma)'; var output = alma.substring( 0, alma.indexof("(")-1 ); alert(output);
update
if need replace values inside brackets , rest of string, try this
var output = alma.replace(/ *\([^)]*\) */g, "");
Comments
Post a Comment