I have a fairly large String that I need to split, so I can put it in an array. Be that as it may, there will be a semicolon followed by Integer , followed by a space, and here I need to break it.
Say for example, I have a String :
first aaa;0 second bbb;1 third ccc;2
I need to break it down so that it becomes:
first aaa;0 second bbb;1 third ccc;2
I assume I can use something like:
Pattern pattern = Pattern.compile(^([0-9]*\s"); myArray = pattern.split(string_to_split);
I don't understand RegEx yet, but for now.
Thanks, who is watching.
In addition, the pattern in which it should be divided will always be a semicolon, followed by only one digit, and then a space.
source share