Last updated 8 months ago
We can get the length of string stored in a variable by writing variable name in following syntax -
${#Variable_Name}
$ VAR="String" $ echo "Size of variable 'VAR' is = ${#VAR}"
Source:
Reference(s)