make character separation checking function more useful and universal