Results 1 to 4 of 4
  1. #1
    Kestrel01 is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Smile Search Substring in String Help Please

    I am trying to write code to search thru a string for a substring for example finding "ele" if the string is elephant. Do i use a for loop? Any help will be much appreciated thanks.

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default

    String (Java Platform SE 6)

    :confused:

    "if the string argument occurs as a substring within this object, then the index of the first character of the first such substring is returned; if it does not occur as a substring, -1 is returned."

  3. #3
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    Have a look at this String method

    String (Java Platform SE 6)

  4. #4
    Kestrel01 is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Replies: 5
    Last Post: 06-22-2010, 09:34 AM
  2. search with part of string
    By virendra in forum Lucene
    Replies: 1
    Last Post: 01-21-2010, 12:56 PM
  3. Reverse a string not using the substring method
    By kathyla18 in forum New To Java
    Replies: 17
    Last Post: 04-08-2009, 04:08 AM
  4. String substring function
    By ravian in forum New To Java
    Replies: 6
    Last Post: 01-02-2008, 07:35 PM
  5. Replies: 0
    Last Post: 11-20-2007, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •