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 -

jsf - How to order SelectItems in custom renderer extending MyFaces HtmlMenuRenderer -

sql server - SQL, get max id of column -