Split String By specific character in cfscript
Hi I want to split string(7<>2,,3<>6<>0.6) by specific character(<>) and store it in array...like c# code :
//whwre dataList=7<>2,,3<>6<>0.6
string[] wordsStrings = Regex.Split(dataList, "<>");
Hi I want to split string(7<>2,,3<>6<>0.6) by specific character(<>) and store it in array...like c# code :
string[] wordsStrings = Regex.Split(dataList, "<>");
You want to use ColdFusion's ListToArray function. Treat the <> as a list delimiter. The important part here is setting the last argument to true, for the multiCharacterDelimiter argument.
dataList = "7<>2,,3<>6<>0.6";
wordsStrings = listToArray(dataList, "<>", false, true);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.