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

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -