• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Double Quotes to My String

 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using the escape charactor for "

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

hope this helps
G
 
Gavin Tranter
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that works great.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic