Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String abbreviate(String s, int maxLength) {
        s = String.valueOf(s); // null check
        if (s.length() > maxLength) {
            s = s.substring(0, maxLength) + "...";
        }
        return s;
    }
}