length

Usage

length ([ STRING ])

The length function returns the number of characters within a provided string [[argument?]]:

 BEGIN {
   print length("Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch")
 }

Parentheses

In traditional versions of awk, the optional parentheses enclosures can be omitted from the string [[argument?]]. However, this legacy form of syntax is deprecated and parentheses enclosures should always be used in current awk scripts.