Loki Eliot Posted December 1, 2016 Share Posted December 1, 2016 Im recieving a string ["VC","ED"] but need to turn it into a list "VC","ED" so i can check it via llListFindListi assumed it would be simple , but i cant figure it out. i'm so tired ll Link to comment Share on other sites More sharing options...
Rolig Loon Posted December 1, 2016 Share Posted December 1, 2016 Delete the square brackets and then use llCSV2List. Link to comment Share on other sites More sharing options...
Rolig Loon Posted December 1, 2016 Share Posted December 1, 2016 Actually, I'm not sure whether you wanted to keep the quote marks in your final list or not. Either way, you can do the cleaning and conversion with something like this: default{ state_entry() { llListen(-12345,"","",""); } listen(integer channel, string name, key id, string message) { llSay(0, "I heard " + message); integer len = llStringLength(message); while (len) { --len; if (~llListFindList(["[",]","\""],[llGetSubString(message,len,len)])) { message = llDeleteSubString(message,len,len); } } llSay(0,"Here's the string with square brackets and quotes removed: " + message); list New = llCSV2List(message); // Here's your list llSay(0,"And here's a dump of a list created from that string, with each list element on a separate line so you can see them: \n" + llDumpList2String(New,"\n")); }} If you really meant to keep the quotes in your final list, just remove the "\"" from that llListFindList line. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now