1

有没有办法使用给定长度的子字符串添加特殊字符?

String example= "abcde & fghijk";

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

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

请帮忙。谢谢

4

0 回答 0