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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -