Objective:
The aim is to take the tweet provided and pass it to a visualization tool to display it on the user interface.
Steps:
I currently have a 'List' displayed on my UI. I need to convert this list into a JavaScript array (so that I can use it with Visualization tools). Each field in the list has been concatenated with 'qqq' at the end for identification purposes.
Tweet:
[*high-pitched yelp* http://t.co/qaluND2Lu3qqq, neutralqqq, 0qqq,
I checked in at Starbucks on #Yelp http://t.co/8wRVos8STjqqq, negativeqqq, -0.159316qqq,
i would like to thank yelp for not helping me find any club around santa monica that plays progressive edm / progressive tranceqqq, positiveqqq, 0.372338qqq,
Nice long bar table & upstairs option (@ Social Kitchen & Brewery) on #Yelp http://t.co/uhQB003NTiqqq, positiveqqq, 0.567625qqq]
Question:
How can I split the text by 'qqq' and store it in a JavaScript array?I attempted the following code snippet:
var str = "*high-pitched yelp* http://t.co/qaluND2Lu3qqq, neutralqqq, 0qqq";
var res = str.split("qqq");
However, this method adds an extra comma (,) at the end of every 'qqq'. I'm feeling lost here.
Is there anyone who can guide me through this?