add iterator constructor for string