how can you cast a character for a specific length?