Last character in a string can be extracted using sed. example:-
$cat test.sh
$cat test.sh
#!/bin/bash
STRING="Humpty Dumpty"
STRING=`echo "$STRING"|sed -e 's/\(^.*\)\(.$\)/\2/'`
echo "STRING=$STRING"
exit 0
Output:-
STRING=y