samedi 1 septembre 2012

Supprimer une chaîne qui est entre deux attributs

String myString = "this #?anystring; is  #?anystring2jk; test"
Remplacer tous les occurrence de la chaîne entre "#?" et ";" et le retirer avec les attributs.
myString.replaceAll("#\\?.*?;", "");   =>    "this is test"  
string.replaceAll(start+".*"+end, "")

Aucun commentaire:

Enregistrer un commentaire