• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

quotes that I want in arguments to main

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes there are escape sequences. Not sure if they work in main though. Good Luck

Mark
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic