Results 1 to 2 of 2
  1. #1
    jayjones149 is offline Member
    Join Date
    Feb 2010
    Posts
    1
    Rep Power
    0

    Default Need help with escape characters

    Hi all,

    I am have trouble writing a program with escape characters in it. The object of the program is to print out 3 letters a, b, and c. What I have to do is fix all of the letters to get each to line up. However it seems that some of my \t are not getting read in the program and it is simply not working. If someone could help i would be really thankful

    code


    System.out.println(" .8.\t\t\t8 888888888o \t\t ,o88888o.");
    System.out.println(" .888.\t\t8 8888 \'88.\t\t 8888 \'88.");
    System.out.println(" :88888.\t\t8 8888 \'88\t\t,8 8888 \'8.");
    System.out.println(" . \\88888.\t\t\t8 8888 ,88\t\t88 8888");
    System.out.println(" .8. \\88888.\t\t8 8888. ,88\'\t\t88 8888");
    System.out.println(" .8\'8. "\88888.\t\t8 8888888888 \t\t88 8888");
    System.out.println(" .8\' \'8. \"88888.\t\t8 8888 \'88.\t\t88 8888");
    System.out.println(" .8\' \'8. \\88888.\t\t8 8888 88\t\t\'8 8888 .8\'");
    System.out.println(" .888888888. \\88888. \t\t8 8888 ,88\'\t\t 8888 ,88\'");
    System.out.println(".8\' \'8. \\88888.\t\t8 888888888P \t\t \'8888888P\"");

    thanks

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    See the API docs for String and its format method and/or PrintStream and its printf method (P.S. System.out is a PrintStream). And, whichever one you look at, don't forget to follow the "format string" link in the methods description.

Similar Threads

  1. Escape Sequence
    By Punter in forum New To Java
    Replies: 4
    Last Post: 02-10-2009, 07:04 AM
  2. Using escape sequence with like clause (%)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-14-2008, 09:57 AM
  3. Using escape sequence with like clause (_)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-14-2008, 09:55 AM
  4. Escape sequence problem
    By eva in forum New To Java
    Replies: 2
    Last Post: 01-21-2008, 10:15 PM
  5. Frog Escape 0.0.1 alpha
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-14-2007, 08:26 PM

Posting Permissions

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