例外をこぼしたいのですが、以下は私の例外です。
[致命的なエラー]Test.xml:18:23:要素タイプ "value"は、一致する終了タグで終了する必要があります</value>
。
今、私は値18だけを取りたいと思います。
私は次のコードで試しました:
System.out.println(java.util.Arrays.toString(e.getMessage().split(":")));
しかし、それは印刷です:
[The element type "value" must be terminated by the matching end-tag "</value>".].
値18だけを取得するにはどうすればよいですか?
次のコードで試してみると:
System.out.println(e.getMessage().toString());
、印刷しているだけです"The element type "value" must be terminated by the matching end-tag "</value>"."