Re: grabbing a line of text if you know the start and finish
From: VisionSet (spam_at_ntlworld.com)
Date: 11/15/03
- Next message: Andrew Thompson: "Re: grabbing a line of text if you know the start and finish"
- Previous message: chirs: "Re: How to find applet on the PC"
- In reply to: neu: "grabbing a line of text if you know the start and finish"
- Next in thread: Andrew Thompson: "Re: grabbing a line of text if you know the start and finish"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 15 Nov 2003 16:33:02 -0000
"neu" <info@nospam.com> wrote in message
news:bp5i8t$7t4$1@sparta.btinternet.com...
> I have a text position and I would like to grab 100 characters before this
> point and 100 charcters after this point.
> Using indexOf(text) , how can I manipulate to see what 100 characters is
> before the indexOf(text) result.?
>
int idx = myString.indexOf(text);
myString.substring(Math.max(0,idx-100), idx);
-- Mike W
- Next message: Andrew Thompson: "Re: grabbing a line of text if you know the start and finish"
- Previous message: chirs: "Re: How to find applet on the PC"
- In reply to: neu: "grabbing a line of text if you know the start and finish"
- Next in thread: Andrew Thompson: "Re: grabbing a line of text if you know the start and finish"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|