Re: Passing tab char in command line
- From: Jeffrey Schwab <jeff@xxxxxxxxxxxxxxxx>
- Date: Thu, 01 Jun 2006 14:30:39 GMT
alejandrina wrote:
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?
<insert what everyone else said about shells />
If the shell doesn't do the kind of character substitution you want, the testTab.main (should that be TestTab?) routine could check for sequences like \t and interpret them itself.
.
- Prev by Date: Re: EnumSet + contains: strange behavior
- Next by Date: Re: Debugger and function calls
- Previous by thread: GNU GPL Mobile Software: Explosives Calculation
- Next by thread: Sorting Objects in an ArrayList
- Index(es):
Relevant Pages
|