vendredi 9 janvier 2015

how to remove the last two caracters of string


I would like to know the more clearly way for remove the last two caracters of a string, without calling external commands, i used something like this.



A="GOOD MORNING"
echo ${A:0:$((${#A}-2))}
GOOD MORNI


Aucun commentaire:

Enregistrer un commentaire