remove rows/cols from beginning in trim()

This commit is contained in:
Ben Fry
2017-01-31 04:58:33 -05:00
parent c90176cf8a
commit 7384e91df6
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -4067,6 +4067,11 @@ public class Table {
}
setColumnCount(lastColumn + 1);
// trim() works from both sides
while (getColumnCount() > 0 && isEmptyArray(getStringColumn(0))) {
removeColumn(0);
}
// remove empty rows (starting from the end)
int lastRow = lastRowIndex();
//while (isEmptyRow(lastRow) && lastRow >= 0) {
@@ -4074,6 +4079,10 @@ public class Table {
lastRow--;
}
setRowCount(lastRow + 1);
while (getRowCount() > 0 && isEmptyArray(getStringRow(0))) {
removeRow(0);
}
}