Just_RC
asked on
String substring?
Everyone:
Good afternoon. If I wanted the first 4 characters of a string wouldn't I just:
#!/usr/bin/ksh
string=ABCDEJGHIJ
snip=${string:0:4}
echo $snip
I can't seem to make the snip variable contain what I want. The only progress (see "Knowledge level on this subject :) ) I've been able to make is to set the Start parameter to a negative number which retruns the whole string.
As always many thanks for the help and encouragement.
RC
Good afternoon. If I wanted the first 4 characters of a string wouldn't I just:
#!/usr/bin/ksh
string=ABCDEJGHIJ
snip=${string:0:4}
echo $snip
I can't seem to make the snip variable contain what I want. The only progress (see "Knowledge level on this subject :) ) I've been able to make is to set the Start parameter to a negative number which retruns the whole string.
As always many thanks for the help and encouragement.
RC
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone...guess I'll skip it (even if its in the book (Rosenblatt & Robbins)
ASKER