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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -