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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World