Re
Et bien alors, tu récupères les caractères du sTring dans un array, il
ne te reste plus qu'à tester caractère par caractère
il existe une classe
StringCharacterIterator(String s) qui te permet de retirer tous les
caractères du String. Que tu peux parcourir, convertir le char en String et avec ce String tester la conversion en chiffre
Une simple itération suffit.
voici le bazar
java.text
Class StringCharacterIterator
java.lang.Object
|
+--java.text.StringCharacterIterator
All Implemented Interfaces:
CharacterIterator, Cloneable
--------------------------------------------------------------------------------
public final class StringCharacterIterator
extends Object
implements CharacterIterator
StringCharacterIterator implements the CharacterIterater protocol for a String. The StringCharacterIterator class iterates over the entire String.
See Also:
CharacterIterator
--------------------------------------------------------------------------------
Field Summary
Fields inherited from interface java.text.CharacterIterator
DONE
Constructor Summary
StringCharacterIterator(String text)
Constructs an iterator with an initial index of 0.
StringCharacterIterator(String text, int pos)
Constructs an iterator with the specified initial index.
StringCharacterIterator(String text, int begin, int end, int pos)
Constructs an iterator over the given range of the given string, with the index set at the specified position.
Method Summary
Object clone()
Creates a copy of this iterator.
char current()
Implements CharacterIterator.current() for String.
boolean equals(Object obj)
Compares the equality of two StringCharacterIterator objects.
char first()
Implements CharacterIterator.first() for String.
int getBeginIndex()
Implements CharacterIterator.getBeginIndex() for String.
int getEndIndex()
Implements CharacterIterator.getEndIndex() for String.
int getIndex()
Implements CharacterIterator.getIndex() for String.
int hashCode()
Computes a hashcode for this iterator.
char last()
Implements CharacterIterator.last() for String.
char next()
Implements CharacterIterator.next() for String.
char previous()
Implements CharacterIterator.previous() for String.
char setIndex(int p)
Implements CharacterIterator.setIndex() for String.
void setText(String text)
Reset this iterator to point to a new string.
Choubanimal :
"Le poilu poilant au poil"