public String replaceFirst(String regex, String replacement)
Replaces the first substring of this string that matches the given regular expression with the given replacement.
T'as maté ce qu'était une "regular expression" avant d'essayer d'utiliser la fonction ?
--------------- Everyone thinks of changing the world, but no one thinks of changing himself | It is the peculiar quality of a fool to perceive the faults of others and to forget his own | Early clumsiness is not a verdict, it’s an essential ingredient.
Marsh Posté le 16-02-2004 à 13:37:25
Bonjour,
j'utilise replaceFirst :
command = "test de remplacement";
commandMod = command.replaceFirst("de", "toto\\titi" );
et je perds les \ dans le remplacement :
test tototiti remplacement
des idées ?
---------------
"Les conneries, c'est comme les impôts, on finit toujours par les payer." Michel Audiard