wood burning stoves 2.0*
The moose likes Java in General and the fly likes quote Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "quote" Watch "quote" New topic
Author

quote

kavins
Greenhorn

Joined: Sep 14, 2002
Posts: 15
Say for example I have a very large string "A........................Z"
Within the string I have several " ie
"A........."..........".........Z".
What should I do so that the compiler ignores the quotes present WITHIN the string.
My first option was to actually place \ infront of the quote within the string.
But since my actuall string is large it is not feasible to put \ manually.

Is there an example which I can refer to?
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
use your editor to do a find and replace: find ", replace with \"
kavins
Greenhorn

Joined: Sep 14, 2002
Posts: 15
Originally posted by Ray Stojonic:
use your editor to do a find and replace: find ", replace with \"


I dont think so thats feasible for a very large environment where the number of files is humangous.
I am working on the code for it right now.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18544
    
  40

Originally posted by kavins:

I dont think so thats feasible for a very large environment where the number of files is humangous.
I am working on the code for it right now.


This problem only exist for Java files, as the compiler needs to figure out when a string starts and stops. It should be okay, for text files of strings. It should just be any other character read from a file.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: quote
 
Similar Threads
How to mask string not conforming to a regular expression pattern
RMI troubleshooting
Finding out the most occuring word in a String?
Array Out of Bounds Exception
How does String str = "str" work?