Java tutorial
//package com.java2s; public class Main { private static boolean isAllWords(String prefix) { char[] array = prefix.toCharArray(); for (Character ch : array) { if (ch < 'A' || ch > 'z' || (ch < 'a' && ch > 'Z')) { return false; } } return true; } }