html - Truncate word that comes before hyphen in jQuery -


i curious how truncate word comes before hyphen in word, example:

[jazz] - 1970's blues 

would become...

the 1970's blues 

i know how in php , there many functions make possible in php... curious how work jquery!

you can try following:

var text="[jazz] - 1970's blues"; alert(text.substring(text.indexof("-")+1)); 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -