Get string from between two characters

前端 未结 7 1178
情歌与酒
情歌与酒 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:07

    If the length of each column is varient, use the examples given here with the split method.

    However, if you have a fixed-sized file format substring will be a much better option. If you look at the implementation of substring (Java 5 and above if I recall correctly) - you can see that it has an O(1) to create the new strings, whereas split uses a regex which is time consuming.

提交回复
热议问题