ListChangeDelims

Converts the delimiters of a list to the new delimiter.

Method Signature

ListChangeDelims(list=[string], newDelimiter=[string], delimiter=[string], includeEmptyFields=[boolean])

Arguments

Argument
Type
Required
Description
Default

list

string

true

string list to convert the delimiters.

newDelimiter

string

true

string the new list delimiter

delimiter

string

false

string the old list delimiter

,

includeEmptyFields

boolean

false

boolean whether to include empty fields in the returned result

false

Examples

Simple Example

Changes the delimiters in the list

Run Example

listChangeDelims( "foo,bar,lorem,ipsum", "|" );

Result: foo|bar|lorem|ipsum

Example with Custom Delimiter

Changes the delimiters in the list using a custom delimiter

Run Example

listChangeDelims( "foo,bar|lorem,ipsum|me|something", "~", "|" );

Result: foo,barlorem,ipsumme~something

Additional Examples

Run Example

// Simple function
writeOutput( ListChangeDelims( "Plant,green,save,earth", "@" ) );
// Member function with custom delimiter
strLst = "1+2+3+4";
writeDump( strLst.listChangeDelims( "/", "+" ) );

Last updated

Was this helpful?