How to use the "split" function with the eval variable

Hi, I’m new to this place.

I found a way to use the split function on the “eva” variable

Input in twitch chat

!foo bar/anything


$(eval const values = "$(querystring)".split("%2F"); values)

Note: You need to be aware of the ### encoding reference to be able to make the split



I have used these values with the urlfetch in the following way:

$(urlfetch $(eval const values = "$(querystring)".split("%2F");
const currency1 = values[0]; 
const currency2 =  values[1]; 
const value =  values[2];
const url = "" +currency1 + "&to=" + currency2  + "&value=" + value;   url))

I hope it has been helpful

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.