Re: Passing tab char in command line




"alejandrina" <apattin@xxxxxxxxx> wrote in message
news:1149096110.999422.142430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I want to pass a tab character as a command line parameter. Ihave this
statement to extract a char from the string:

char delim = args[0].charAt(0);

The problem is how do you write the command line? I've tried all of
these:

java testTab "\t"
java testTab "\\t"
java testTab \t
java testTab \\t
java testTab "\u0009"
java testTab \u0009

none work. "delim" above never gets the right character. Interestingly,
when I submit

java testTab "\u0009" or
java testTab "\\t"


args[0] contains a string of length = 2, the first character being "\"
and the second is the tab. Obviously, the parser feels the need to
"escape" my backslash character. How do you disable this behavior?

Thanks!

Have you tried hitting the Tab key rather than typing backslashes and the
't' character?

--
Rhino


.



Relevant Pages

  • Re: Passing tab char in command line
    ... I want to pass a tab character as a command line parameter. ... input to a program which is typically called a "shell". ...
    (comp.lang.java.programmer)
  • Re: Passing tab char in command line
    ... escape processing of command line parameters. ... You could pass tab by ... I want to pass a tab character as a command line parameter. ...
    (comp.lang.java.programmer)
  • Re: Compiling error
    ... whereby the command is missing a true character; ... what you probably have are spaces representing the ... TAB character. ...
    (alt.os.linux)
  • Re: Passing tab char in command line
    ... I want to pass a tab character as a command line parameter. ...
    (comp.lang.java.programmer)
  • Passing tab char in command line
    ... I want to pass a tab character as a command line parameter. ...
    (comp.lang.java.programmer)