Split Method - Split into 3 parts

1

I have an instruction to separate two words from a string and put it in an array. This instruction is working very well. Follow below:

public static List<String> converterCamelCase(String original) {

        String[] arraySplit = original.split("(?<=[a-z])(?=[A-Z])"); 
}

Example: "CompositeName", result will be "Name" (0) and Composite (1).

Only now I need to adjust this instruction to separate in 3 parts - Example: CPF name, contribution "Name" (0) CPF (1) Contributor (2)

How can I do this?

I want to make this same statement separate two or three words. At the moment I can only separate in UP TO 2 parts. Example of words: name - "name", compoundName - "name", "Composite", numeroCPF - "numero", "CPF".

In the case of a string with numbers, it will happen that the method receives this string formatting, eg: retrieve10Prime - "retrieve", "10", "First".

Is it possible to do this in the same statement?

    
asked by anonymous 24.05.2017 / 06:23

0 answers