# ListQualify

Inserts a string at the beginning and end of list elements.

If this BIF is being called from inside of a query component, and the qualifier is a single quote, any single quotes in the values will be escaped by doubling them up. This protects against SQL Injection attacks.

## Method Signature

```
ListQualify(list=[string], qualifier=[string], delimiter=[string], elements=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
```

### Arguments

| Argument                  | Type      | Required | Description                                                                                                    | Default |
| ------------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------- | ------- |
| `list`                    | `string`  | `true`   | The list to qualify.                                                                                           |         |
| `qualifier`               | `string`  | `true`   | The string to insert at the beginning and end of each element.                                                 |         |
| `delimiter`               | `string`  | `false`  | The delimiter used in the list.                                                                                | `,`     |
| `elements`                | `string`  | `false`  | The elements to qualify. If set to "char", only elements that are all alphabetic characters will be qualified. | `all`   |
| `includeEmptyFields`      | `boolean` | `false`  | If true, empty fields will be qualified.                                                                       | `false` |
| `multiCharacterDelimiter` | `boolean` | `false`  |                                                                                                                | `false` |

## Examples

### Simple example for listQualify function with delimiter

To insert a string or character before and after the list elements.

[Run Example](https://try.boxlang.io/?code=eJzLySwuUbBVUErOz0lJKy3OzM%2BzKkrMzMm3MjQxscopTU5NtTIxU7LmKi%2FKLEn1Ly0pKC3RUMgBagosTczJTKuEcHQUlGqUgISVkoKmgqY1FwAAjRtV)

```java
list = "boxlang:railo:144:boxlang:46";
writeOutput( listQualify( list, "|", ":" ) );

```

Result: |boxlang|:|railo|:|144|:|boxlang|:|46|

### Example for listQualify function with elements

To insert a string or character before and after the alphabet list elements only.

[Run Example](https://try.boxlang.io/?code=eJzLySwuUbBVUErOz0lJKy3OzM%2BzKkrMzMm3MjQxscopTU5NtTIxU7LmKi%2FKLEn1Ly0pKC3RUMgBagosTczJTKuEcHQUlGqUgIQViHD2cAxSUtBU0LTmAgDllR0D)

```java
list = "boxlang:railo:144:boxlang:46";
writeOutput( listQualify( list, "|", ":", "CHAR" ) );

```

Result: |boxlang|:|railo|:144:|boxlang|:46

### Example for listQualify function with includeEmptyFields

If includeEmptyFields is true, empty value add in list elements.

[Run Example](https://try.boxlang.io/?code=eJzLySwuUbBVUErOz0lJKy3OzM%2BzKkrMzMm3MjQxsbLKKU1OTbWyMjFTsuYqL8osSfUvLSkoLdFQyAFqCyxNzMlMq4RwdBSUapSAhBWIcPZwDALSJUWlqQqaCprWXADWtx%2BD)

```java
list = "boxlang:railo:144::boxlang::46";
writeOutput( listQualify( list, "|", ":", "CHAR", true ) );

```

Result: |boxlang|:|railo|:144:||:|boxlang|:||:46

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxVjsEKwjAMhu97itCDdDDMA0wFUQRhIlK8Cs5lGmi70bUMwYc3UxA8JOQ%2F5Pt%2BRDDsekvQJn%2BL3HkYOT6g4balQD5CQ5YdRwoa82wMch1T7FPUYHmIp3S13D41qCEG9nes0o0IhzQwVmujClCXaaGCHGagFnVYTSOxzBDhQK6m8JNnQqkEC0tQH1Kx6WyzE1rnC%2BEV5mz2qvz22CbXa5CPqcj8v81r8oniDeOFSOE%3D)

```java
// Simple function with different delimiter(/)
writeOutput( listQualify( "string/Boxlang/susi/LAS", "^", "/" ) & "<br><br>" );
// Member function
strList = "Boxlang,Boxlang,LAS,SUSI";
writeDump( strlist.listQualify( "|" ) );

```

## Related

* [GetToken](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/gettoken)
* [ListAppend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listappend)
* [ListAvg](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listavg)
* [ListChangeDelims](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listchangedelims)
* [ListCompact](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listcompact)
* [ListContains](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listcontains)
* [ListContainsNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listcontainsnocase)
* [ListDeleteAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listdeleteat)
* [ListEach](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listeach)
* [ListEvery](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listevery)
* [ListFilter](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfilter)
* [ListFind](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfind)
* [ListFindNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfindnocase)
* [ListFirst](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfirst)
* [ListGetAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listgetat)
* [ListGetEndings](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listgetendings)
* [ListIndexExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listindexexists)
* [ListInsertAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listinsertat)
* [ListItemTrim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listitemtrim)
* [ListLast](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listlast)
* [ListLen](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listlen)
* [ListMap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listmap)
* [ListNone](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listnone)
* [ListPrepend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listprepend)
* [ListReduceRight](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listreduceright)
* [ListRemoveDuplicates](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listremoveduplicates)
* [ListRest](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listrest)
* [ListSetAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listsetat)
* [ListSome](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listsome)
* [ListSort](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listsort)
* [ListToArray](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listtoarray)
* [ListTrim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listtrim)
* [ListValueCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listvaluecount)
* [ListValueCountNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listvaluecountnocase)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listqualify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
