Extraire un mot d'une chaîne de caractères
bonjour ;
j'ai un petit probléme avec charAt je veux récupérer tout le mot mais avec cette fonction j'ai que le premier carectére du mot comment faire svp voici mon bout de code
Code:
1 2 3 4 5 6 7 8 9 10 11
| public static void main(String[] args) {
String s="if Outlook=sunny than play_tennis=no";
String domaine="Outlook";
System.out.println(""+s);
System.out.println(""+s.indexOf("Outlook"));
int x =s.indexOf("Outlook")+domaine.length()+1;
System.out.println(""+s.charAt(x));
} |