Skip to content

Commit 9d8d2c5

Browse files
authored
Create string2.sh
1 parent 1b78d43 commit 9d8d2c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

string2.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
string_var="Hi Team, My name is Simon Legah, working in MLT, GTA "
2+
#echo "The value of string_var value is: " ${string_var}
3+
echo ${string_var}
4+
echo $string_var
5+
echo "The length of the string is: " ${#string_var}
6+
echo ${string_var:20:14} # This should display the string values between the first 20 characters and the last 14.
7+
echo ${string_var:20} # This should display the string excluding the first 20 characters.
8+
#Index from right end of the string
9+
echo ${string_var: -10} #This should display the last 10 characters in the string.
10+
echo ${string_var: -22} #This should display the last 22 characters in the string.

0 commit comments

Comments
 (0)