How to parse a String containing XML in Java and retrieve the value of the root node?

前端 未结 6 999
小鲜肉
小鲜肉 2020-11-28 06:32

I have XML in the form of a String that contains

HELLO! 

How can I get the String \"Hello!\" from the XML?

6条回答
  •  忘掉有多难
    2020-11-28 06:52

    I think you would be look at String class, there are multiple ways to do it. What about substring(int,int) and indexOf(int) lastIndexOf(int)?

提交回复
热议问题