Hello everyone,
I am having a small problem, does someone know how to break a long string into small groups of 3 characters. I've tried it but its not working.
Here's a sample of my code:
int begindex =0, endindex = 3;
String plaintext = null;
String block;
StringBuffer sbplaintext = new StringBuffer();
try{
while ((input = fin.read()) != -1) {
sbplaintext.append((char) input);
}
plaintext = sbplaintext.toString();
for(int i=0; i < plaintext.length();i++){
begindex += 3;
endindex += 3;
}
I got a string buffer "sbplaintext", (convert into string) and my objective is to make a group a 3 chars.
Thanks in advance for your help.