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

Method left

src/main/java/com/opslab/util/StringUtil.java:261–267  ·  view source on GitHub ↗

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

(String input, int count)

Source from the content-addressed store, hash-verified

259 * @return 截取字符串
260 */
261 public static String left(String input, int count) {
262 if (isEmpty(input)) {
263 return "";
264 }
265 count = (count > input.length()) ? input.length() : count;
266 return input.substring(0, count);
267 }
268
269 /**
270 * 截取字符串右侧指定长度的字符串

Callers 2

testLeftRigthMethod · 0.95
leftEqualsMethod · 0.95

Calls 1

isEmptyMethod · 0.95

Tested by 1

testLeftRigthMethod · 0.76