Penguin
Note: You are viewing an old revision of this page. View the current version.

Two Methods For Finding The Length Of a String

  • test="This is a string"

Method 1)

  • echo ${#test}

Method 2)

  • expr length test

Both will give you the correct length of 16.