Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to split a comma delimited string into an array in cfscript

Tags:

coldfusion

Is there an easy way to split a comma delimited string into an array using cfscript?

Something similar to the following JavaScript:

var a = "a,b,c".split(",");
like image 433
Kenneth J Avatar asked Sep 06 '11 17:09

Kenneth J


People also ask

How to split comma separated string into array?

Method 1: Using split() method The split() method is used to split a string on the basis of a separator. This separator could be defined as a comma to separate the string whenever a comma is encountered. This method returns an array of strings that are separated.

How to convert comma separated string to array in typescript?

Answer: Use the split() Method You can use the JavaScript split() method to split a string using a specific separator such as comma ( , ), space, etc. If separator is an empty string, the string is converted to an array of characters.

How do you convert a comma separated string to an array in Python?

You can use the str. split method.


1 Answers

var a = ListToArray("a,b,c,d,e,f");     

https://cfdocs.org/listtoarray

like image 179
Henry Avatar answered Oct 10 '22 07:10

Henry