101,180 views
37 votes
37 votes
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 Fresa
by
2.6k points

1 Answer

18 votes
18 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:

User Yoeli
by
3.1k points