MCPcopy Create free account
hub / github.com/0opslab/opslabJutil / left

Method left

src/main/java/com/opslab/helper/StringHelper.java:170–176  ·  view source on GitHub ↗

截取字符串左侧指定长度的字符串 @param input 输入字符串 @param count 截取长度 @return 截取字符串

(String input, int count)

Source from the content-addressed store, hash-verified

168 * @return 截取字符串
169 */
170 public static String left(String input, int count) {
171 if (isEmpty(input)) {
172 return "";
173 }
174 count = (count > input.length()) ? input.length() : count;
175 return input.substring(0, count);
176 }
177
178 /**
179 * 截取字符串右侧指定长度的字符串

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected