java - a method that recieves String input and divides it into 1,2 and 3 different sections -
java - a method that recieves String input and divides it into 1,2 and 3 different sections - i need more basic method! split words 1,2,3 consecutive compartments, output "water" should in terms of array string! e.g input of water should produce output {"w","a","t","e","r","wa","at","te","er","wat","ate","ter"} public void split(string word) { int x=(word.length())/2; int z=word.length(); string[] partition= new string[5]; (int i=0; i<x; i++){ string new1=character.tostring(word.charat(i)); string new2 = character.tostring(word.charat(i))+character.tostring(word.charat(i+1)); string new3 = character.tostring(word.charat(i))+character.tostring(word.charat(i+1))+character.tostring(word.charat(i+2)); string new4 = removeduplicate(character.tostring(word.charat(z-2))+ character.tostring(word.charat(z-1))); ...