(New string split method) The split method in the Stringclass returns an array o
ID: 3610195 • Letter: #
Question
(New string split method) The split method in the Stringclass returns an array of strings consisting of the substringssplit by the delimiters. However, the delimiters are not returned.Implement the following new method that returns an array of stringsconsisting of the substrings split by the matches, including thematches.public static String[] split(String s, Stringregex)
For example, split("ab#12#453", "#")returns ab, #,12, #,453 in an array of String, and split("a?b?gf#e","[?#]") returns a, b, ?, b, gf, #, and e in an array ofString.