Link to home
Start Free TrialLog in
Avatar of greddin
greddinFlag for United States of America

asked on

Help splitting a string up

I have a a Javascript variable that is coming back with a special delimited string.  (It's how SharePoint stores multiple values).

I'm initializing my Javascript variable like this:

var sponsor=$(this).attr("ows_Sponsor");
if(sponsor==null)
sponsor='';

Open in new window


My values are coming back like these.

;#SG3;#ACC;#

Open in new window

or
;#SG3;#ACC;#AETC;#

Open in new window


How can I spit the strings up so they look more like this?

SG3,ACC

Open in new window

or
SG3,ACC,AETC

Open in new window


Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of greddin

ASKER

Thank you Julian.  Worked great!
You are welcome.