• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I make this string ok?  RSS feed

 
Martin Lefebvre
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to define a String tmp.
Something like this, but it does'nt work...

What do I need to do to make it valid??
Thanks
 
Stephen Foy
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a string with quotes in it, you need use a \ before the quotation.

\"


[ December 17, 2006: Message edited by: Stephen Foy ]
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:



Use a backslash to indicate that the " is part of the String and not the end of it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!