Article View: aus.computers.java
Article #995Re: Searching a string in Java for a Substring, anyone know how?
From: Cannon
Date: Wed, 01 Dec 1999 00:00
Date: Wed, 01 Dec 1999 00:00
19 lines
1522 bytes
1522 bytes
How about:
String str = s.toLowerCase();
if (str.indexOf("find me")>-1){
System.out.println("Found you!");
}
--
#WB###
Don't e-mail if your a student. I hate students, spam and attachments.
ronnie gillis <warren.buffet@usa.net> wrote in message
news:382c242b.4852097@news.mtt.net...
> I have a computer assignment that is due next week and we have to be
> able to search a string entered by the user, for a substring that is
> entered by another user. We have only just learned the basics of
> Java and some methods and designing classes. We are just in the midst
> of learninig if statements and it somehow must relate to this but I
> can't wrap my head around it. We haven't used many methods that would
> search a string. PLEASE HELP!!!!!!!!!!!!!!!!!
Technical Details
Message-ID:
<%V114.729$Hy3.10161@nsw.nnrp.telstra.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<382c242b.4852097@news.mtt.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,48eb6f058b5ae742 X-Google-Attributes: gid10d6db,public From: "Cannon" <wb@nospam.basketball.net.au> Subject: Re: Searching a string in Java for a Substring, anyone know how? Date: 1999/12/01 Message-ID: <%V114.729$Hy3.10161@nsw.nnrp.telstra.net> X-Deja-AN: 555155813 References: <382c242b.4852097@news.mtt.net> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 944024315 203.35.100.252 (Wed, 01 Dec 1999 15:58:35 EST) Organization: Customer of Telstra Big Pond Direct X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 01 Dec 1999 15:58:35 EST Newsgroups: aus.computers.java