Write a program to count the number of characters in a given string.

clear
echo "Enter the String to find the length"
read st
l=`echo $st | wc -c`
echo "Length of the string is `expr $l - 1`"


OutPut

Enter the String to find the length
Jaisha
Length of the string is 6

No comments:

Post a Comment