Results 1 to 6 of 6
- 12-09-2011, 11:10 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 2
- Rep Power
- 0
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
- 12-09-2011, 01:10 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,568
- Rep Power
- 14
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?
- 12-09-2011, 02:25 PM #3
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.
- 12-09-2011, 03:58 PM #4
Member
- Join Date
- Dec 2011
- Posts
- 2
- Rep Power
- 0
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.
- 12-09-2011, 04:55 PM #5
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,568
- Rep Power
- 14
Re: How to remove text up to second full stop in a string
Then see the API docs for String and its "split" method.
- 12-10-2011, 04:03 PM #6
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.
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
Similar Threads
-
Searching for keywords only instead of full-text search with Lucene
By DetRRG in forum LuceneReplies: 0Last Post: 02-25-2011, 09:13 AM -
Use stop button to stop moving (stop timers) on JPanel
By mneskovic in forum New To JavaReplies: 3Last Post: 07-23-2010, 01:50 PM -
Need help with Assignment. [String splitting] [Full code provided]]
By jeanfrg in forum New To JavaReplies: 8Last Post: 05-15-2010, 05:05 PM -
can i remove a file from a input? can provided a full code for me?
By reeveliew in forum New To JavaReplies: 3Last Post: 05-06-2010, 08:10 AM -
how to remove whitespaces in a text
By christina in forum New To JavaReplies: 2Last Post: 08-03-2007, 06:24 PM
Bookmarks