# llList2CSV

*LSL function*

```lsl
string string llList2CSV(list src);
```

- `list src`: Source list to convert.

- Returns: `string`
- Energy: 10

More precisely the values are separated with a comma and a space (", ").

This function's functionality is equivalent to &lt;code style="white-space: nowrap;">[llDumpList2String](/functions/llDumpList2String/)(**src**, ", ");

The result of this function is more or less the [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) format, but it does not conform in all its details.

To reverse the process use [llCSV2List](/functions/llCSV2List/). But see the Caveat.

Returns a [string](https://wiki.secondlife.com/wiki/string) of comma separated values taken in order from **src**.

```lsl title="How to use" frame="terminal"
string result = llList2CSV([]);
```

## Caveats

- [llCSV2List](/functions/llCSV2List/) will not reverse the process if there are commas or oddly matched angle brackets (**&lt;** and **>**) in any of the original strings. For details see the article [llCSV2List](/functions/llCSV2List/).
- One way around this is to first use [llEscapeURL](/functions/llEscapeURL/) on any user-supplied strings before adding them to the list. [llUnescapeURL](/functions/llUnescapeURL/) will reverse [llEscapeURL](/functions/llEscapeURL/).
- If your strings may contain commas but not unmatched angle brackets you can wrap your strings with angle brackets (&lt; and >) like you would use double quotes around the string and then use [llGetSubString](/functions/llGetSubString/) with START at 1 and END at -2 to remove them.

## Examples

<details open>
<summary>Example 1</summary>

```lsl
default
{
    state_entry()
    {
        list my_list = [FALSE, PI, "a string", ZERO_VECTOR, ZERO_ROTATION, NULL_KEY];
        llOwnerSay(llList2CSV(my_list));
    }
}
```

</details>

## See also

### Functions

- [llCSV2List](/functions/llCSV2List/)
- [llDumpList2String](/functions/llDumpList2String/)
- [llParseString2List](/functions/llParseString2List/)
- [llParseStringKeepNulls](/functions/llParseStringKeepNulls/)

### Articles

- [Typecast](https://wiki.secondlife.com/wiki/Typecast)

---

*Source: [LlList2CSV](https://wiki.secondlife.com/wiki/LlList2CSV) on the Second Life Wiki. Content from the Second Life Wiki article LlList2CSV (revision 1194309, 2015-01-22), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llList2CSV/
