Created
February 26, 2013 17:49
-
-
Save Macagare/5040487 to your computer and use it in GitHub Desktop.
CF: convert list to numeric list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* convert list to a list with numeric elements | |
* | |
* @param required string numList source list with elements] | |
* @return list with numeric items | |
*/ | |
string function toNumericList( required string numList ) { | |
var numListLen = listLen( arguments.numList ); | |
var result = ""; | |
if ( numListLen > 0 ) { | |
for ( var i = 1; i <= numListLen; i = i + 1 ) { | |
if ( isNumeric( listGetAt( arguments.numList, i ) ) ) { | |
result = listAppend( result, listGetAt( arguments.numList, i ), "," ); | |
} | |
} | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment