var

This is only going to give you one character from the string str1.
char1=mid(str1,i,1)
Do you have other code?

If you already have ABCDefgh then you don't need to do anything to it.