Created
January 9, 2014 17:42
-
-
Save coderofsalvation/8338500 to your computer and use it in GitHub Desktop.
returns length of a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # returns length of a string | |
| # @param string input | |
| # usage: strlen "foo" (output: 3) | |
| # length="$( strlen "foo" )"; echo "$length" (output: 3) | |
| strlen(){ | |
| echo "${#1}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment