How to Split a String Only on the First Occurrence of Delimiter ?
In this tutorial we learn how to split based on delimiter within limit.
We know we can split a string over some delimiter in Java.
Suppose we run split() on a string.
String str = “This is a java program”;
This will yield a string array that looks something like this:
[“This”, “is”, “a”, “java” “program”]