// récupères ta ligne au préalable String maLigne = ....; // la liste qui va avoir tous les mots trouvés LinkedList<String> motsRecuperes = new LinkedList<String>(); // on extrait tous les mots de ta ligne séparés par un espace String [] motsExtraits = maLigne.split( " " ); int nombreMots = motsExtraits.length(); for ( int = 0; i < nombreMots; i++ ){ // si un mot correspond à ce que tu veux, tu l'ajoutes à ta liste if ( motsExtraits[i].equals("un truc que tu veux") motsRecuperes.add(motsExtraits[i]); } // enfin tu copies tout ça dans un tableau car tu as apparemment envie d'en avoir un String [] tableau = new String [ motsRecuperes.length() ]; // on parcourt la liste et on rempli le tableau ListIterator iterateur = motsRecuperes.iterator(); int cpt = 0; while ( i.hasNext() ){ tableau[i] = (String) i.next(); i++; }