Results 1 to 2 of 2
Thread: bypass or override the backslash
- 04-06-2012, 02:32 PM #1Member
- Join Date
- Apr 2012
- Rep Power
bypass or override the backslash
I'm working on a DateTimelibrary in java to use in a basic4android project. One of the things I worked on is the DateTimeformat and it's escape character, the backslash. Now normally you could say something like "\s" and it would print "s" instead of the seconds. My boss wants me to keep this in the same way, typing one backslash to get the character after that. What I do for all the other dateformat things is I send the string to a seperate class where it uses substring and with a switch sees what it has to do (e.g. for "HH" write hours in a 24 hour format with extra 0 if it's lower than 10). Now I can pass a backslash, without doubling it for the compiler not to throw an error saying it's not a recongized escape sequence.
I know I could do a double backslash to pass a single one, but my boss doesn't want this, nor does he want me to use another character than backslash. I think it's impossible, but he keeps telling me it is and I should keep thinking about it.
anyone who can help me?
- 04-06-2012, 03:31 PM #2
- By saketh321 in forum New To JavaReplies: 8Last Post: 08-21-2010, 10:57 PM
- By dipanshu.agrawal in forum NetworkingReplies: 2Last Post: 04-16-2010, 03:46 PM
- By Mobius-1 in forum New To JavaReplies: 3Last Post: 12-14-2009, 01:39 AM
- By rp181 in forum Advanced JavaReplies: 4Last Post: 10-15-2009, 10:54 AM
- By federal102 in forum New To JavaReplies: 1Last Post: 11-02-2008, 02:33 AM