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
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 1254
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: 1254
Thanks, that works great.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24048
    
  13

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Adding Double Quotes to My String
 
Similar Threads
How to escape smart quotes in java?
Identifier too long exception in SQL server 7
How to use trim() with String.split(regx)?
How do you pass a string from servlet to jsp if jsp is on another server?
StringSplit regex question: missing part of my string?