How can I escape from special character using stringutils substring with a given length JAVA

239 views Asked by At

Is there any way to add a special character using a substring with a given length?

String example= "abcde & fghijk";

System.out.printLn("(StringUtils.substring(StringEscapeUtils.escapeXml(example)),0,12));

current output("abcde &amp f")
expected output("abcde &amp fghij")

Please help. Thanks

0

There are 0 answers