Caltech Library logo

string length [STRING]

This command will return the length of STRING.

Typical command line

    string length "friend"

Would return 6

    string length "plum"

Would return 4

Piping content

NOTE: To read content from standard input we use the -i - option.

    echo -n "friend" | string -i - length

Would return 6

    echo -n "plum" | string -i - length

Would return 4