String.split
expects a regular expression argument. An unescaped |
is parsed as a regex meaning “empty string or empty string,” which isn’t what you mean.
More Related Contents:
- How to split a string if any chracter is found in java
- Java: splitting a comma-separated string but ignoring commas in quotes
- Splitting a Java String by the pipe symbol using split(“|”)
- Split string to equal length substrings in Java
- Split string with dot as delimiter
- Splitting on comma outside quotes
- Java string split with “.” (dot) [duplicate]
- Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces
- Using Java to find substring of a bigger string using Regular Expression
- How to split String with some separator but without removing that separator in Java? [duplicate]
- Get the index of a pattern in a string using regex
- How to use regex in String.contains() method in Java
- Compare one String with multiple values in one expression
- Replace the last part of a string
- Remove trailing zero in Java
- Java: Split string when an uppercase letter is found
- How to Split a mathematical expression on operators as delimiters, while keeping them in the result?
- How to replace ” \ ” with ” \\ ” in java
- Validate a file name on Windows
- Check if string ends with certain pattern
- Use Java and RegEx to convert casing in a string
- Java split is eating my characters
- Java String.replace/replaceAll not working
- How to implement a SQL like ‘LIKE’ operator in java?
- Raw Strings in Java – for regex in particular. Multiline strings
- Regular Expressions on Punctuation
- Split string into repeated characters
- Replacing single ‘\’ with ‘\\’ in Java
- Parse Date from String in this format : dd/MM/yyyy [to dd/MM/yyyy]
- Java replace all square brackets in a string