javascript - How to remove comma before special character using jquery -


my string :-

var str = #805|6412,6413,#803|6392,6393,#802|6382,6383,6384,#96|622,623,#88|589,592,#810|6461,6462,6464 

now want remove comma before every (#) sign ?

try this. replace ,# #. removing ,s before # character.

var str = "#805|6412,6413,#803|6392,6393,#802|6382,6383,6384,#96|622,623,#88|589,592,#810|6461,6462,6464"; str = str.replace(/,#/g, '#'); 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -