Results 1 to 2 of 2
  1. #1
    cs3
    cs3 is offline Member
    Join Date
    Sep 2012
    Posts
    5
    Rep Power
    0

    Default Minimizing Number of Characters. HELP :(

    I am trying to write my initials. Is there any way to minimize the number characters on each line E.g. no trailing
    characters or unnecessary white spaces?


    Java Code:
    public class Initials {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		
    		System.out.println ("  CCCCCCCCC         GGGGGGGG         SSSSSSS");
    		System.out.println (" CCCCCCCCCCCC     GGGGGGGGGGGG     SSSSSSSSSSS");
    		System.out.println ("CCCCC     CCCC   GGGGG     GGGG   SSSSS     SSS");
    		System.out.println ("CCCC        C    GGGG        G    SSSS        S");
    		System.out.println ("CCCC             GGGG               SSSS");       
    		System.out.println ("CCCC             GGGG                  SSSS");
    		System.out.println ("CCCC             GGGG                     SSSS");
    		System.out.println ("CCCC             GGGG     GGGGG   S        SSSS");
    		System.out.println ("CCCCC     CCCC   GGGGG      GGG   SSS     SSSSS");
    		System.out.println (" CCCCCCCCCCCC     GGGGGGGGGGGG    SSSSSSSSSSSS");
    		System.out.println ("   CCCCCCCC         GGGGGGGG        SSSSSSSSS");
    	}
    
    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Minimizing Number of Characters. HELP :(

    Yeah, the easiest way is to put the Strings into a file and then iterate through the Strings of the file printing each one.

Similar Threads

  1. Replacing number characters with blanks
    By rpark712 in forum New To Java
    Replies: 3
    Last Post: 01-26-2012, 04:15 PM
  2. Replies: 8
    Last Post: 01-21-2012, 02:14 AM
  3. Replies: 1
    Last Post: 10-28-2011, 09:18 AM
  4. Display number of characters like bar chart
    By Dreaming in forum New To Java
    Replies: 6
    Last Post: 10-17-2011, 07:11 AM
  5. Replies: 1
    Last Post: 02-13-2011, 04:09 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
  •