File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quotes in strings

 
David Garratt
Ranch Hand
Posts: 212
Eclipse IDE Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to embed a " character in a string - I must be simple but I can't see how to do it. In VB I would probably use chr$(34).

Thanks in advance

Dave
 
Scott Dunbar
Ranch Hand
Posts: 245
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Escape it:


[ October 31, 2005: Message edited by: Scott Dunbar ]
 
vasu maj
Ranch Hand
Posts: 396
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can negate the special nature of the character by adding a backslash in front of it. It will be treated as a regular character and not as a quote.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47288
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look up the "escape" sequences with a \ in.
\" \' \b \n \r \t etc
 
David Garratt
Ranch Hand
Posts: 212
Eclipse IDE Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to you all for replying so quickly with exactly what I needed to know.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic