Getting a character from a string

Basic types / Character type

strV="ABC"

#${var:index:1} is one character, the index counts from 0
charA=${strV:0:1}
#charA is "A"
charB=${strV:1:1}
#charB is "B"

#a negative index counts from the end (the space before - is required)
charC=${strV: -1}
#charC is "C"

charList=""
for ((i = 0; i < ${#strV}; i++)); do
    charList+="${strV:i:1};"
done
#charList is "A;B;C;"

#sed: . is any one character, & is the matched character
fromSed=$(sed 's/./&;/g' <<< "$strV")
#fromSed is "A;B;C;"

echo "charA is $charA"
echo "charB is $charB"
echo "charC is $charC"
echo "charList is $charList"
echo "fromSed is $fromSed"