aspose file tools*
The moose likes Beginning Java and the fly likes Adding Double Quotes to My String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Adding Double Quotes to My String" Watch "Adding Double Quotes to My String" New topic
Author

Adding Double Quotes to My String

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1436
In the following code I need Double Quotes included with the path string. I have tried several things but can not get anythig to work.



[edited to try and restore readability]
[ July 13, 2007: Message edited by: Fred Rosenberger ]
Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
try using the escape charactor for "

\" -> "
\\ -> \
\n -> newline
\t -> tab

hope this helps
G
Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
Seems my post was broken somehow possible because I include escape charactors???

Anyway trying using the escape charactor for " which is a backslash followed by "

hope that helps
G
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1436
Thanks, that works great.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Note that this kind of code leaves you wide open to SQL injection attacks; you should be using PreparedStatement, which will not only handle that for you, but also will be a heck of a lot easier than building up a complex string like this!


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding Double Quotes to My String