1

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

newbird
  • 39
  • 1
  • 4

0 Answers0