Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列が含まれるたびに文字列を分割したいのです|が、splitメソッドは正規表現のみを受け入れます。正規表現|は、各文字の後に文字列を分割しますが、これは私が望むものではありません。using\u007Cも同じことを行います。
|
split
\u007C
を使用してみ\|ましたが、それは私に与えます: Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )。
\|
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
別の提案は、 を使用することPattern.quote("|")です。
Pattern.quote("|")