This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

quotes that I want in arguments to main

 
Dan Walin
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am passing arguments to main that include quotes. I WANT the quotes to be passed to main but they seem to disappear (get stripped out). The argument I'm passing is:

<?xml version= "1.0" encoding="UTF-8" ?> <cmrequestor> <CCNoteId>A80XDT </CCNoteId> <CCCaseid>002595062</CCCaseid> <CCProcessTime>2005-03-22 15:52</CCProcessTime>


But when main gets the arguments, they look like this (quotes are missing):


<?xml version= 1.0 encoding= UTF-8 ?> <cmrequestor> <CCNoteId>A80XDT </CCNoteId> <CCCaseid>002595062</CCCaseid> <CCProcessTime>2005-03-22 15:52</CCProcessTime>


Is there any way I can ensure the quotes are kept? Actually, as I'm writing this I just thought about escape characters. Maybe there is an escape sequence \" or "" or something like that?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes there are escape sequences. Not sure if they work in main though. Good Luck

Mark
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, escaping does work in main - so if you wanted to print out "Hello World" (with the quotes) you would pass the argument like so:

java HelloWorld "\"Hello World\""

Regards,
JD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic