Java String Sub String substring(String input, int maxLength)

Here you can find the source of substring(String input, int maxLength)

Description

substring

License

Open Source License

Declaration

public static String substring(String input, int maxLength) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String substring(String input, int maxLength) {
        if (input == null)
            return null;
        else/* w w  w . j  a va  2 s.c  om*/
            return (input.length()) <= maxLength ? input : input.substring(0, maxLength);
    }
}

Related

  1. substring(String _text, int _idx)
  2. substring(String baseString, int start, int end)
  3. subString(String input, char start, char end)
  4. substring(String input, int expectedLength)
  5. substring(String input, int maxLength)
  6. subString(String input, String startStr, String endStr)
  7. subString(String name)
  8. substring(String origin, int len)
  9. subString(String original, String regex)