Re: parsing contents of variable for a specific value...
From: Scaramouche (spamReallySucks_at_forgetit.com)
Date: 11/20/03
- Next message: Adam Steiner: "Re: Question: Is there a library for IP and low level TCP and UDP programming"
- Previous message: nos: "Re: java browser compatibility"
- In reply to: nos: "Re: parsing contents of variable for a specific value..."
- Next in thread: Greg: "Re: parsing contents of variable for a specific value..."
- Reply: Greg: "Re: parsing contents of variable for a specific value..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 Nov 2003 21:49:52 GMT
thank you for taking the time to try and help out.
i thought the same thing and when i checked, endidx did contain a -1. this
is somewhat confusing since the spelling and case of the closing (</TITLE>)
tag is correct, i thought the slash might be throwing it off but since it's
a string i don't think that's it.
thanks again!
"nos" <nos@nospam.com> wrote in message
news:98avb.258761$Tr4.806047@attbi_s03...
> i would suggest you first check the result of the urlContent.indexOf()
> method invocations to see if you are getting -1 or null or whatever
> (some html pages use lower case)
>
> "Scaramouche" <spamReallySucks@forgetit.com> wrote in message
> news:o68vb.11938$M31.256257@twister.tampabay.rr.com...
> > i have the contents of an html page stored within a variable. i would
> like
> > to parse out the value of the TITLE tag,
> > ie..<TITLE>this_value_is_what_i_want</TITLE>
> >
> > String title=null;
> > int startidx=0, endidx=0;
> >
> > startidx = urlContent.indexOf("<TITLE>");
> > startidx += 7;
> > endidx = urlContent.indexOf("</TITLE>");
> > title = urlContent.substring(startidx, endidx);
> > System.out.println(title); //this doesn't work for me. generates an
> out
> > of bounds err msg.
> >
> > is there a way of doing this with java2...trying to stay away from xml
> since
> > it's new to me.
> >
> > thanks
> >
> >
>
>
>
- Next message: Adam Steiner: "Re: Question: Is there a library for IP and low level TCP and UDP programming"
- Previous message: nos: "Re: java browser compatibility"
- In reply to: nos: "Re: parsing contents of variable for a specific value..."
- Next in thread: Greg: "Re: parsing contents of variable for a specific value..."
- Reply: Greg: "Re: parsing contents of variable for a specific value..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|