Delete unused spaces in an Array
Hello
im delevoping a program where users can fill inn different textboxes such as username, ID and other information. This info is saved into an array. The array is sorted by what the user puts into the ID field.
function laan(evt:MouseEvent) :void {
if (boxDate.text != "") {
feideId = boxFeide.text
id = boxId.text
dato = boxDate.text
checkBox() //Function to check if textboxes are empty or not
if (feideId.length > 7 && feideId.length < 10 && boxId.text != "") {
tfOutput.text = "Dato(" + dato + ") " + feideId +" har lånt overgang: " + id + "\n \n"
laanArray [id] = new Array("\n Dato[" + dato + "] Feide[" + feideId + "] ID[" + id + "]\n")
clear() // Function to empty all textboxes
trace("laanArray " + laanArray)
}
}
This array then gets saved to a .txt file.
The only problem is if theres unused spaces in the array that .txt file gets "," where the unused spaces in the array are.
Here are pictures that explain better.
Current Result

Wanted Result

