Results 1 to 3 of 3
- 09-17-2011, 12:32 AM #1
Remove part of a string
For example if I have a string like:
String str = "hello 4235 blah blah\nhello2 4353242 blah blah\n"; ... etc
By the way:
The Strings always change so I can't do str.replace("hello 4235 blah blah\n", "");
Last edited by PhQ; 09-17-2011 at 12:35 AM.
Re: Remove part of a string
You could split the String on "\\n" and then take the parts you desire, you could use subString after finding the location of the next \n with indexOf.
- 09-17-2011, 12:52 AM #3
- By drogba123 in forum New To JavaReplies: 2Last Post: 03-20-2011, 11:52 AM
- By sidd0123 in forum New To JavaReplies: 9Last Post: 04-23-2010, 02:52 AM
- By mac in forum New To JavaReplies: 0Last Post: 01-28-2010, 03:23 AM
- By virendra in forum LuceneReplies: 1Last Post: 01-21-2010, 01:56 PM
- By eva in forum New To JavaReplies: 1Last Post: 12-23-2007, 07:58 AM