function to generate char range