Results 1 to 3 of 3
  1. #1
    know.how is offline Member
    Join Date
    Aug 2011
    Posts
    4
    Rep Power
    0

    Default Pls help to print string in given format

    java
    jav
    ja
    j
    How to print in this format.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default

    Java Code:
    System.out.println("java\njav\nja\n\j");
    Recommended reading: How to ask questions the smart way

    db

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Look at the String class's methods. It has some that will help you create the sub strings you want to print.

Similar Threads

  1. To print * in right angle format
    By venkatakrishnan in forum New To Java
    Replies: 9
    Last Post: 07-24-2011, 04:29 PM
  2. How to format the print statement
    By ftrengnr in forum New To Java
    Replies: 1
    Last Post: 09-18-2010, 10:02 PM
  3. Text/String format..??
    By Neullson in forum New To Java
    Replies: 14
    Last Post: 07-23-2010, 08:51 AM
  4. String.format not in javadoc
    By ortollj in forum New To Java
    Replies: 3
    Last Post: 11-08-2009, 05:14 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
  •