Results 1 to 6 of 6
- 12-09-2011, 10: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, 12:10 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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, 01:25 PM #3
Re: How to remove text up to second full stop in a string
Look at the String class. It has methods for working with String and substrings.i want to remove the text up to the second full stop and store in another variable.
- 12-09-2011, 02: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, 03:55 PM #5
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
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, 03: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.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Searching for keywords only instead of full-text search with Lucene
By DetRRG in forum LuceneReplies: 0Last Post: 02-25-2011, 08:13 AM -
Use stop button to stop moving (stop timers) on JPanel
By mneskovic in forum New To JavaReplies: 3Last Post: 07-23-2010, 12:50 PM -
Need help with Assignment. [String splitting] [Full code provided]]
By jeanfrg in forum New To JavaReplies: 8Last Post: 05-15-2010, 04: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, 07:10 AM -
how to remove whitespaces in a text
By christina in forum New To JavaReplies: 2Last Post: 08-03-2007, 05:24 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks