visibleLength method

int visibleLength(
  1. String input
)

Function to remove ANSI escape sequences from a string Function to calculate the visible length of a string (excluding ANSI escape sequences)

Implementation

/// Function to calculate the visible length of a string (excluding ANSI escape sequences)
int visibleLength(String input) {
  return removeAnsiEscapeSequences(input).length;
}