Results 1 to 3 of 3
- 09-16-2011, 11:32 PM #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-16-2011 at 11:35 PM.
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-16-2011, 11:52 PM #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, 01: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