Android examples for java.lang:String Search
Returns true if a string contains any upper case characters.
import android.text.TextUtils; import java.util.ArrayList; import java.util.Locale; public class Main{ /**//from ww w .ja va 2s . c o m * Returns true if cs contains any upper case characters. * * @param cs the CharSequence to check * @return {@code true} if cs contains any upper case characters, {@code false} otherwise. */ public static boolean hasUpperCase(final CharSequence cs) { final int length = cs.length(); for (int i = 0, cp = 0; i < length; i += Character.charCount(cp)) { cp = Character.codePointAt(cs, i); if (Character.isUpperCase(cp)) { return true; } } return false; } }