You could use the String class' to_ascii method. It gives you an array of ascii values for a string.
print("asdf".to_ascii()[0])
will print 97
Using this you can check the value for each character against a range of numbers . 65-90 for capital letters and 97-122 for lower case. There's also some regex thing you could do.