Java String Left left(String text, int max)

Here you can find the source of left(String text, int max)

Description

left

License

Apache License

Declaration

public static String left(String text, int max) 

Method Source Code

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

public class Main {
    public static String left(String text, int max) {
        if (text.length() <= max)
            return text;
        return text.substring(0, max - 3) + "...";
    }/*from   ww  w  .j a v a 2  s .  com*/
}

Related

  1. left(String str, int len, String appendStrIfOver)
  2. left(String str, int length)
  3. left(String str, int size)
  4. left(String string, int length)
  5. left(String text, int len)
  6. left(String value, int length)
  7. left(String var0, int var1)