Difference between revisions of "LlCSV2List"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
(note that list items are strings) |
Void Singer (talk | contribs) m (updated lsl tags) |
||
Line 7: | Line 7: | ||
|return_text=made from '''src''' as comma separated values. | |return_text=made from '''src''' as comma separated values. | ||
|spec=Anything between "<" and ">" is considered a single value regardless of the existence of a comma between. For every "<" there needs to be a corresponding ">". | |spec=Anything between "<" and ">" is considered a single value regardless of the existence of a comma between. For every "<" there needs to be a corresponding ">". | ||
< | <lsl> | ||
llCSV2List("<>,>,a") == ["<>", ">", "a"]; //didn't match the last ">" | llCSV2List("<>,>,a") == ["<>", ">", "a"]; //didn't match the last ">" | ||
llCSV2List("<<>,>,a") == ["<<>,>", "a"]; //matched everything | llCSV2List("<<>,>,a") == ["<<>,>", "a"]; //matched everything | ||
llCSV2List("<<<>,>,a") == ["<<<>,>,a"]; //didn't match the last "<" | llCSV2List("<<<>,>,a") == ["<<<>,>,a"]; //didn't match the last "<" | ||
</ | </lsl> | ||
|caveats=*It eats leading and trailing spaces from values. | |caveats=*It eats leading and trailing spaces from values. | ||
Line 18: | Line 18: | ||
* All items in the returned list are strings until [[typecast]]. | * All items in the returned list are strings until [[typecast]]. | ||
|constants | |constants | ||
|examples=< | |examples= | ||
<lsl> | |||
default | default | ||
{ | { | ||
Line 32: | Line 33: | ||
} | } | ||
} | } | ||
}</ | }</lsl> | ||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llList2CSV]]|}} | |also_functions={{LSL DefineRow||[[llList2CSV]]|}} |
Revision as of 07:57, 11 February 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: list llCSV2List( string src );196 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a list made from src as comma separated values.
• string | src |
Do not confuse this function with the CSV format, it is not the CSV format.
Specification
Anything between "<" and ">" is considered a single value regardless of the existence of a comma between. For every "<" there needs to be a corresponding ">". <lsl> llCSV2List("<>,>,a") == ["<>", ">", "a"]; //didn't match the last ">" llCSV2List("<<>,>,a") == ["<<>,>", "a"]; //matched everything llCSV2List("<<<>,>,a") == ["<<<>,>,a"]; //didn't match the last "<" </lsl>
Caveats
- It eats leading and trailing spaces from values.
- Anything between "<" and ">" is considered a single value, see Specification for further details.
- All items in the returned list are strings until typecast.
Examples
<lsl> default {
state_entry() { string csv = "first,second,third"; list my_list = llCSV2List(csv); llOwnerSay("CSV: " + csv); integer i; for (i=0; i<llGetListLength(my_list); ++i) { llOwnerSay("my_list[" + (string)i + "]: " + llList2String(my_list,i)); } }}</lsl>
See Also
Functions
• | llList2CSV | |||
• | llDumpList2String | |||
• | llParseString2List | |||
• | llParseStringKeepNulls |
Articles
• | Typecast |