R – Good way to rename fields in Actionscript array

actionscriptactionscript-3apache-flexarrays

Should be easy but google couldn't give me a straight answer. I have an array. The fields in the array have underscores that I would like to remove e.g. "Column_1" to "Column 1". Does anyone know a good way to do this without looping through the whole array and rebuilding it anew? I didn't see any methods in the reference that would make this easy. thx

Best Answer

Depending on where you are using this Array, you could use the labelFunction to format the data before presenting it. It is present in Lists, DataGrids and Trees.

But you'd only need this if you have a very large data and wouldn't want to loop over all the records before showing them. A labelFunction would "reprocess" the label everytime before it's presented.