How to remove first and last character of a string?

后端 未结 12 2103
遥遥无期
遥遥无期 2020-12-08 08:56

I have worked in SOAP message to get LoginToken from Webservice, and store the LoginToken in String and used System.out.println(LoginToken); to print. This prin

12条回答
  •  忘掉有多难
    2020-12-08 09:23

    Another solution for this issue is use commons-lang (since version 2.0) StringUtils.substringBetween(String str, String open, String close) method. Main advantage is that it's null safe operation.

    StringUtils.substringBetween("[wdsd34svdf]", "[", "]"); // returns wdsd34svdf

提交回复
热议问题