Java String Shorten shortenString(String orig, int maxLength)

Here you can find the source of shortenString(String orig, int maxLength)

Description

shorten String

License

Open Source License

Declaration

public static String shortenString(String orig, int maxLength) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file

public class Main {
    public static String shortenString(String orig, int maxLength) {
        if (orig == null || orig.length() <= maxLength) {
            return orig;
        }//ww  w  . j a va2s  .  c o  m
        return orig.substring(0, maxLength);
    }
}

Related

  1. shortenPart(String currentPart)
  2. shortenPath(final String path)
  3. shortenPrefix(String prefix)
  4. shortenRemoteRef(final String origin, final String ref)
  5. shortenString(String orig, int charsToRemove)
  6. shortenString(String s, int maxLength)
  7. shortenString(String s, int requiredLength)
  8. shortenString(String source, int minLength, int maxLength, String suffix)
  9. shortenString(String str, int i)