Results 1 to 5 of 5
  1. #1
    gvs048 is offline Member
    Join Date
    Apr 2013
    Posts
    16
    Rep Power
    0

    Default how to get substring form a string

    .....some text..... Mobiles *(*n items*) See more >> .....some text..... Laptops *(*n items*) See more >> .....some text..... Games ( n items ) See more >> .....some text..... Cloths ( n items ) See more >> .....some text.....

    Now from this string how can i get "Mobiles,Laptops ,Games,Cloths".

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: how to get substring form a string

    Read the API documentation for the String class; you'll find numerous methods that can do the job.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    gvs048 is offline Member
    Join Date
    Apr 2013
    Posts
    16
    Rep Power
    0

    Default Re: how to get substring form a string

    I am unable to find the solution in API document... can any one suggest me, how to achieve this task....

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: how to get substring form a string

    What about the String.indexOf( ... ) method so you can at least find a '(' character in your String, for starters? For sure, there is no findMyItems( ... ) method in the String class; you have to use your imagination and creativity ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    gvs048 is offline Member
    Join Date
    Apr 2013
    Posts
    16
    Rep Power
    0

    Default Re: how to get substring form a string

    Thanks for your post....

Similar Threads

  1. Searching for a substring within a String
    By Tryx in forum New To Java
    Replies: 7
    Last Post: 07-16-2012, 08:12 PM
  2. A string and substring problem
    By calnastic in forum New To Java
    Replies: 4
    Last Post: 07-18-2011, 09:02 PM
  3. How do I remove a substring from a string?
    By Unnel in forum New To Java
    Replies: 16
    Last Post: 07-11-2011, 11:56 AM
  4. Search Substring in String Help Please
    By Kestrel01 in forum New To Java
    Replies: 3
    Last Post: 10-26-2010, 06:48 PM
  5. String substring function
    By ravian in forum New To Java
    Replies: 6
    Last Post: 01-02-2008, 07:35 PM

Tags for this Thread

Posting Permissions

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