Utilisation de StringUtils
bonjour,
j'ai un soucis sur une compilation qui rouspète sur
% javac -cp commons-lang3-3.1.jar TestJmr.java
TestJmr.java:8: cannot find symbol
symbol : variable StringUtils
location: class java.lang.String
System.out.println ("StringUtils curieux:"+entry.StringUtils.replace("@", ";"));
^
1 error
bizarrement, il ne veut pas de la syntaxe entry.StringUtils.replace("@", ";") qui pourtant serait bien pratique.
Y a t'il une astuce ?
merci de vos conseils
Code:
1 2 3 4 5 6 7 8 9 10
| import org.apache.commons.lang3.StringUtils;
public class TestJmr {
public static void main(String[] args) {
String entry = "az@er@rt";
String tempo = StringUtils.replace(entry, "@", ";");
System.out.println ("StringUtils curieux:"+entry.replaceAll("@", ";"));
System.out.println ("StringUtils curieux:"+entry.StringUtils.replace("@", ";"));
}
} |