|
public static void main( String[] args ) {
String str = "ABC\ud800\udc00";
int index = str.indexOf( 0x10000 );
if ( index == -1 ) {
System.out.println("String ne prend pas en charge les caractères supplémentaires.");
} else {
System.out.println("Index = " + index);
}
}
|
|
public static void TestIndexOf() {
String str = "A\u0300";
int index = str.indexOf(A);
if (index == -1 ) {
System.out.println("OK!");
}else {
System.out.println("Le caractère 'A' ne doit pas être considéré comme correspondant à A\\u0300");
}
}
|
|
public static void TestIndexOf() {
String str = "Voix ambiguë d'un coeur qui au zéphyr préfère les jattes de kiwis. "
int index = str.indexOf("VOIX");
if (index == -1 ) {
System.out.println("IndexOf ne prend pas en charge les correspondances tenant compte de l'environnement local.");
}else {
System.out.println("OK!");
}
}
|
|