I have following piece of code and in this code I want to convert the String array into dynamically generated char array based on the length of String array. Is my approach/technique is feasible or i have to choose some other datatype...actually i have to perform logic on each and every character of word thats why i am breaking the String array to char[] array....
private String[] function(String[] words) {
String[] names = words;
char[] CArray= null;
for (int i = 0; i < names.length ; i++){
CArray = names[i].toCharArray();
}
for (int i = 0; i < CArray.length ; i++){
System.out.print(CArray[i]);
}
return names;
}
Guys plz try to under stand that I want the names of char[] array to be generated in sequence quto based on the length of String array means there should be 4 char[] arrays if there are 4 words having name in a sequence such as S0,S1,S2,S3 or anything else..!!!!!
Okay guys plz this is what I want to achieve
char[] S1 or anyname = words[0].toCharArray();
char[] S2 or anyname = words[1].toCharArray();
so on...depending upon the no of String arrays passed,,,such that I am left with char[] arrays S1,S2,S3 to carry my further operationss.....plz plz now figure out it ..!! Hope i made clear understanding of the ques..??