Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Breaking up some data

Thorne Kaiser
Nice Guy
Join date: 29 Nov 2005
Posts: 132
04-13-2006 16:20
I have data that looks like this:

From: Location-5501-xyz-Hello There

I would like to break this up and use it. I need to know how to disregard the "From: " and use the data that's inbetween the dashes.

Thanks for your help
Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
04-13-2006 16:26
CODE

list data = llParseString2List("From: Location-5501-xyz-Hello There", [":","-"], []);


Then just ignore the 1st index, which would be the "From" part, then you'd need to script the leading space off the 2nd index. This assumes of course that the last part, where you have the "Hello There" will not itself contain hyphons or colons.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
04-13-2006 16:46
CODE

list data = llParseString2List("From: Location-5501-xyz-Hello There", [": ","-"], []);


A tiny change saves you having to strip the space off, but still requires the lack of a ": " string in the later part.

CODE

list data = llParseString2List("From: Location-5501-xyz-Hello There", ["From: ","-"], []);


Should also work, only give the list things it needs, as you as you know it's going to actually say "From: " each time.