[thelist] ColdFusion - ListToArray using a string rather than a character

rudy r937 at interlog.com
Thu Apr 19 18:31:10 CDT 2001


>I need to split a long variable (from a textbox) using
>a string (such as ';;;'), but when I use ';;;' in
>ListToArray() function as the delimiter, it splits the
>string where one semicolon exists as well. I need it
>to split only if three semicolon's exist in a row.

hi jon

replace the three consecutive semicolons with a character that you do not
expect to be present in the string, then use that character as your
ListToArray delimiter

  <cfset myarray = ListToArray(ReplaceList(form.text,";;;","^"),"^")>

disclaimer: not tested


rudy





More information about the thelist mailing list