[debutant] probleme de string
bonjour a tous alors j'ai eu beau passer toute les methodes associées a la class string il y a une chose a laquelle je n'ai pas de reponse comment fait-on pour se balader a l'interieur d'une string par exemple comment peut-on faire en sorte de recuperer 4 char a l'interieur d'une string ?
Merci d'avance :)
Re: [debutant] probleme de string
Bonjour,
Citation:
Envoyé par lamoueste
j'ai eu beau passer toute les methodes associées a la class string
Hum ... pas toutes :wink:
Citation:
Envoyé par API Java
public String substring(int beginIndex, int endIndex)
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.
Examples:
"hamburger".substring(4, 8 ) returns "urge"
"smiles".substring(1, 5) returns "mile"
Parameters:
beginIndex - the beginning index, inclusive.
endIndex - the ending index, exclusive.
Returns: the specified substring.
Throws:
IndexOutOfBoundsException - if the beginIndex is negative, or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex.
Merci de bien consulter l'API avant de poster :wink: