I am writing an application in which I receive a message that is the sequence tag1 = value1 | tag2 = value2 | tag3 = value3 etc. I want to break it around | delimiter.
After reading Javadoc, there is nothing to say that the String.split (String regex) method is guaranteed to support the original message order. I played, and everything looks fine, but I would rather not stick to this approach if I get caught later.
So, does anyone know if there are situations where the order of the array elements returned by split () can be changed from the original string? Or can someone point out any documentation that says the order will be saved?
(Apologies if this is a hoax, but I cannot find a similar question on the site.)
source
share