This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Parsing of StringBuffer(URGENT) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Parsing of StringBuffer(URGENT)" Watch "Parsing of StringBuffer(URGENT)" New topic

Parsing of StringBuffer(URGENT)

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
I have defined String Buffer of 2K capacity. Server is send me data withing that capacity of string Buffer. After StringBuffer recieves data from the server on client side, I want to parse it. I have delimeter ":" to parse the stringBuffer?
I tried to use StringTokenizer, Substring. But I can't get it.
Here is my example:
import java.applet.Applet;
import java.util.*;
public class sbDemo extends Applet{
StringBuffer sb;
StringTokenizer st;
public void init(){
st = new StringTokenizer(sb,":");
System.out.println("The String is --->" + st.nextToken());
Michael Dean

Joined: Jul 31, 2000
Posts: 9
Angela: modify your code as follows:
st = new StringTokenizer(sb.toString(),":");
StringTokenizer takes arguments of type String, not StringBuffer...

subject: Parsing of StringBuffer(URGENT)
Similar Threads
need to transfer productID from url to action class in struts 2
String conversion
StringBuffer Very Urgent please
how to print in capital of each frist word
StringIndexOut OfBoundsException