a word that begins with an uppercase accented (java) [duplicate]
Possible Duplicate:
Detecting words that start with an accented uppercase using regular expressions
in java ,how to test if a string begins with an uppercase letter accented ,like this Ëfdk,Ä...
do you have some ideas
You can use Character.isUppercase() method.
public class MainClass {
public static void main(String args[]) {
System.out.println(Character.isUpperCase('C'));
}
}
See Javadoc
String s="Ëfdk,Ä";
char[] a = s.toCharArray();
for (int i=0;i<a.length;i++)
{
if ( a[i] != null && Character.isUpperCase(a[i]))
System.out.println(a[i]);
}
精彩评论