Results 1 to 5 of 5
Thread: String manipulation
- 07-14-2011, 07:30 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 24
- Rep Power
- 0
- 07-14-2011, 07:36 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 339
- Rep Power
- 5
If the double-quotes are actually part of the input String, you can remove them using the String.substring(..) method to extract the substring starting at the second character (index 1) and ending at the length-1 character.
- 07-14-2011, 07:49 PM #3
Member
- Join Date
- Jun 2011
- Posts
- 24
- Rep Power
- 0
thanks for your reply..
This can be done, if my input is one string, Since I know the size. But, I have 10,000 strings in a file and i need to remove the double quotes for every string. After removing double quotes, I need to compare the string without double quotes with the string from other file. Is their any possibility for this?
- 07-15-2011, 02:38 PM #4
Member
- Join Date
- Jul 2011
- Posts
- 26
- Rep Power
- 0
If you just want to remove double quotes hope you can use "replace" in string,which will help you out.and just compare with other strings.
- 07-16-2011, 01:41 PM #5
Senior Member
- Join Date
- Jun 2008
- Posts
- 339
- Rep Power
- 5
Well you can either read the strings from the file and remove the double quotes from them one by one (then write them out to another file?), or, as acmohan suggested, read the whole file as a single string and replace the double quotes with empty strings. This assumes that you can read the file as a single string and that there are no double quotes in it that you don't want to remove.
You haven't supplied enough information to give a precise answer. If you explain what you're trying to achieve more exactly, you might get more useful answers...
Similar Threads
-
String manipulation
By i4ba1 in forum Advanced JavaReplies: 2Last Post: 12-22-2010, 08:53 AM -
String Manipulation
By tmotse in forum New To JavaReplies: 1Last Post: 10-14-2010, 01:25 PM -
Help needed with string manipulation
By stringkilla in forum New To JavaReplies: 47Last Post: 09-07-2010, 03:25 AM -
String manipulation example (Title case)
By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 09:04 AM -
String Manipulation Task
By hiranya in forum New To JavaReplies: 1Last Post: 11-19-2007, 11:07 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks