Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Question 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?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: bypass or override the backslash

    Moved from New to Java. Lets keep all Android related question in one place.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. trying to bypass activation
    By saketh321 in forum New To Java
    Replies: 8
    Last Post: 08-21-2010, 09:57 PM
  2. Trying to bypass proxy
    By dipanshu.agrawal in forum Networking
    Replies: 2
    Last Post: 04-16-2010, 02:46 PM
  3. How do you Use Backslash as a Delimiter?
    By Mobius-1 in forum New To Java
    Replies: 3
    Last Post: 12-14-2009, 12:39 AM
  4. Backslash, File directories, and streams
    By rp181 in forum Advanced Java
    Replies: 4
    Last Post: 10-15-2009, 09:54 AM
  5. How to handle \ (backslash) in regular expressions
    By federal102 in forum New To Java
    Replies: 1
    Last Post: 11-02-2008, 01:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •