Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String getVerticalText(String text) {
        StringBuffer stringBuffer = new StringBuffer();
        if (text != null && text.length() > 0) {
            int length = text.length();
            for (int i = 0; i < length; i++)
                stringBuffer.append(text.charAt(i) + "\n");
        }
        stringBuffer.deleteCharAt(stringBuffer.lastIndexOf("\n"));
        return stringBuffer.toString();
    }
}