Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2362 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  pb avec replaceFirst

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

pb avec replaceFirst

n°643777
candide2
Posté le 16-02-2004 à 13:37:25  profilanswer
 

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
mood
Publicité
Posté le 16-02-2004 à 13:37:25  profilanswer
 

n°643781
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 16-02-2004 à 13:39:37  profilanswer
 

Citation :


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 ? :whistle:


---------------
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.

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  pb avec replaceFirst

 

Sujets relatifs
Plus de sujets relatifs à : pb avec replaceFirst


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)