Here you can find the source of substring(String input, int expectedLength)
Parameter | Description |
---|---|
comment | a parameter |
commentLength | a parameter |
public static String substring(String input, int expectedLength)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww .ja v a2 s . c om*/ * @param comment * @param commentLength * @return */ public static String substring(String input, int expectedLength) { String output = input; if (input != null && input.length() > expectedLength) { output = input.substring(0, expectedLength); } return output; } }