Site Tools


printlen

# $EPIC: printlen.txt,v 1.3 2006/08/19 04:05:34 sthalik Exp $

Synopsis:

$printlen(<text>)

Technical:

  • The return value is the number of printable characters in <text>.
  • ANSI escape sequences will be counted as printable characters by this function!
    Convert <text> via $stripcrap(ANSI <text>) first if you suspect it may contain ansi escape sequences.

Practical:

Useful if you want to format columns of things that may contain highlight attributes.

Returns:

number of *printable* characters in <text>

Examples:

$printlen(blahC4,2fooBbar) returns 10

printlen.txt · Last modified: 2006/08/29 16:08 by 127.0.0.1