How to remove all String text before equals ('=') sign Java

前端 未结 4 917
自闭症患者
自闭症患者 2021-01-21 07:51

I\'d like to parse a string so I can build an XML document.

I have:

String value = \"path=/Some/Xpath/Here\";

I\'ve parsed it this way

4条回答
  •  孤街浪徒
    2021-01-21 08:50

    Although the question is tagged with regex here is a solution using substring

        String[] tokens = s.substring(s.indexOf("=") + 1).split("/");
    

    or

        String[] tokens = s.substring(s.indexOf("=/") + 1).split("/");
    

提交回复
热议问题