Hi all..i'm urgently need any attention here..pliz help to solve this problem..
The description of my problem is like dis >> let say now i have 100 length of a text. Now , i need to break it into multiple parts, accordingly to the max lenght of a part for one time is 30.So, it should be to returned like dis >>
text [1]="blablabla. ." -->text.length =30
text [2]="blablabla. ." -->text.length =30
text [3]="blablabla. ." -->text.length =30
text [4]="blablabla. ." -->text.length =10
I have write a pieces of code that may explain what i try to do..but its not really work..i hope anybody out there can help me..thanks a lot..
code:
for (int i=0; i<fullMsg.lengt h(); i++){
singlLen ++;
}
if (singlLen == LEN-1){
System.out.prin t("splitMsg: i="+i+"\n");
System.out.prin t("splitting new msg["+msgCnt+"]="+fullMsg.subs tring(beginPos, i)+"\n");
msg[msgCnt] = fullMsg.substri ng(beginPos, i);
singlLen = 0;
msgCnt ++;
beginPos = i+1;
}
The description of my problem is like dis >> let say now i have 100 length of a text. Now , i need to break it into multiple parts, accordingly to the max lenght of a part for one time is 30.So, it should be to returned like dis >>
text [1]="blablabla. ." -->text.length =30
text [2]="blablabla. ." -->text.length =30
text [3]="blablabla. ." -->text.length =30
text [4]="blablabla. ." -->text.length =10
I have write a pieces of code that may explain what i try to do..but its not really work..i hope anybody out there can help me..thanks a lot..
code:
for (int i=0; i<fullMsg.lengt h(); i++){
singlLen ++;
}
if (singlLen == LEN-1){
System.out.prin t("splitMsg: i="+i+"\n");
System.out.prin t("splitting new msg["+msgCnt+"]="+fullMsg.subs tring(beginPos, i)+"\n");
msg[msgCnt] = fullMsg.substri ng(beginPos, i);
singlLen = 0;
msgCnt ++;
beginPos = i+1;
}
Comment