- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Split a String with Escaped Delimiters?
The split(String regex) method of the String class splits this string around matches of the given regular expression.
Example
public class Sample{ public static void main(String args[]){ String s = "|A|BB||CCC|||"; String[] words = s.split("\|"); for (String string : words) { System.out.println(string); } } }
Output
A BB CCC
Advertisements