Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static String appendColumnSpaces(String value, int columnWidth) {
        StringBuilder builder = new StringBuilder();
        int spaceCount;
        if (value == null) {
            builder.append("null");
            spaceCount = columnWidth - 4;
        } else {
            builder.append(value);
            spaceCount = columnWidth - value.length();
        }
        for (int i = 0; i < spaceCount; i++) {
            builder.append(" ");
        }
        return builder.toString();
    }
}