on ‎2007 Apr 06 4:46 AM
how to convert StringBuffer to String Array ?
StringBuffer strContent=new StringBuffer();
for(int i=0;i<3;i++){
strContent.append("This is new message:" +i);
}
//how to add to this
String[] strArrContent = {};
Request clarification before answering.
Hi Yzme,
Put a seperater in between the strings like &,
<i>strConent.append("This is a new message"i"&");</i>
Now you can split the stringbuffer into an array;
<i>strArrContent[] = strContent.split("&");</i>
This will split the stringbuffer into elements of Array with a seperator as "&";
Regards,
Prashil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.