Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default How to remove text up to second full stop in a string

    Hi,

    Good afternoon to every one.

    I want to know the java syntax to remove text up to second full stop in a string.

    For example, a string "Behav.Skills.Discipline" is there.

    Here i want to remove the text up to the second full stop and store in another variable.

    According to the above example, i want only "Discipline" as the result.

    What is the syntax?


    Thanks in advance,
    Sundaravaradhan

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: How to remove text up to second full stop in a string

    Will it always be only three parts or can it be four parts? I.E. should you from a.b.c.d return c.d, c, or d?

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,789
    Rep Power
    25

    Default Re: How to remove text up to second full stop in a string

    i want to remove the text up to the second full stop and store in another variable.
    Look at the String class. It has methods for working with String and substrings.

  4. #4
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Re: How to remove text up to second full stop in a string

    Yes, it always be three segments.

    I want the third segment always.

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: How to remove text up to second full stop in a string

    Then see the API docs for String and its "split" method.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: How to remove text up to second full stop in a string

    Thread moved from 'Advanced Java'

    There's nothing advanced about removing text up to second full stop in a string. As advised, see the docs for the String class. You could also look at String's replaceAll(...) method, which takes a regex as parameter.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 0
    Last Post: 02-25-2011, 09:13 AM
  2. Use stop button to stop moving (stop timers) on JPanel
    By mneskovic in forum New To Java
    Replies: 3
    Last Post: 07-23-2010, 01:50 PM
  3. Replies: 8
    Last Post: 05-15-2010, 05:05 PM
  4. Replies: 3
    Last Post: 05-06-2010, 08:10 AM
  5. how to remove whitespaces in a text
    By christina in forum New To Java
    Replies: 2
    Last Post: 08-03-2007, 06:24 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
  •