| 264 | } |
| 265 | |
| 266 | translateToString(trimRight = false, startColumn = 0, endColumn = this._length): string { |
| 267 | // Clamp bounds |
| 268 | const start = Math.max(0, Math.min(startColumn, this._length)); |
| 269 | const end = Math.max(start, Math.min(endColumn, this._length)); |
| 270 | |
| 271 | let result = ''; |
| 272 | for (let x = start; x < end; x++) { |
| 273 | const cell = this.getCell(x); |
| 274 | if (cell) { |
| 275 | const chars = cell.getChars(); |
| 276 | result += chars; |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | if (trimRight) { |
| 281 | result = result.trimEnd(); |
| 282 | } |
| 283 | |
| 284 | return result; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | // ============================================================================ |