Get string from between two characters

前端 未结 7 1193
情歌与酒
情歌与酒 2021-01-27 04:28

I need to get string from between two characters. I have this

S= \"10:21:35 |Manipulation       |Mémoire centrale   |MAJ Registre mémoire\"

a

7条回答
  •  天涯浪人
    2021-01-27 05:02

    You probably want this:

    String[] s = "10:21:35 |Manipulation |Mémoire centrale |MAJ Registre mémoire".split("\\|");
    

    There's also method trim() which removes trailing spaces from the strings.

提交回复
热议问题