Results 1 to 4 of 4
  1. #1
    jspexception is offline Member
    Join Date
    Jan 2012
    Posts
    27
    Rep Power
    0

    Default append character in string '\'???

    Hi
    i want to append '\' to a string how i can !!!

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,528
    Blog Entries
    7
    Rep Power
    20

    Default Re: append character in string '\'???

    A lazy way:

    Java Code:
    String s= "foo";
    char c= '\\';
    String result= s+c;
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    jspexception is offline Member
    Join Date
    Jan 2012
    Posts
    27
    Rep Power
    0

    Default Re: append character in string '\'???

    THanKS!!!!!


  4. #4
    stchman's Avatar
    stchman is offline Member
    Join Date
    Apr 2011
    Location
    Saint Louis, Missouri
    Posts
    97
    Rep Power
    0

    Default Re: append character in string '\'???

    Even lazier:

    Java Code:
        String result = "foo" + '\\';
    If you aren't programming in Java, well that's just too bad.
    I'd rather be using Ubuntu.

Similar Threads

  1. Removing last character from a String
    By newToJava3 in forum New To Java
    Replies: 2
    Last Post: 11-28-2010, 12:43 AM
  2. split the String into character...
    By Godfrey125 in forum New To Java
    Replies: 2
    Last Post: 11-23-2010, 05:21 PM
  3. compare String to the character .
    By Bulelakes in forum JDBC
    Replies: 12
    Last Post: 07-28-2010, 11:35 AM
  4. Taking a character off the end of a string.
    By AJArmstron@aol.com in forum New To Java
    Replies: 5
    Last Post: 05-05-2010, 02:56 AM
  5. how to get next character/string
    By doha786 in forum New To Java
    Replies: 3
    Last Post: 03-28-2009, 04:04 AM

Posting Permissions

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