144k views
1 vote
Write a function split that takes a string, splits it at every occurrence of a delimiter, and then populates an array of strings with the split pieces, up to the provided maximum number of pieces.

User Wafs
by
5.0k points

1 Answer

4 votes

Answer:

You can use the split method of String class from JDK to split a String based on a delimiter splitting a comma-separated String on a comma, breaking a pipe delimited String on a pipe or splitting a pipe delimited String on a pipe.

Step-by-step explanation: