Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool IsAlphabetical(string p)
- {
- /*returns true if every character in the passed
- argument is either a lower- or upper-case letter
- of the English alphabet; false otherwise */
- bool result = true;
- byte[] word = StringToByteArray(p);
- foreach(byte b in word)
- {
- if(b < 65)
- {
- return false;
- }else{
- if (b > 122){
- return false;
- }else{
- if((b > 90) && (b < 97)){
- return false;
- }
- }
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement