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
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.