javascript - Remove part of a string before a certain position -


i have string want cut , remove first part.

something 'abcded-cddndcasds--xyz--jkajsjasasasasas'

i want remove before position x.

so far can find position of x, can't find quick function remove before.

thanks

try this

 $(function(){    var str = 'abcded-cddndcasds--xyz--jkajsjasasasasas';     var indexofx = str.indexof("x");     alert(str.substring(indexofx,str.length));  }); 

demo


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -