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

Method rtrim

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

截取字符串右侧第0位到第Num位 @param str 处理的字符串 @param num 截取的位置 @return 截取后的字符串

(String str, int num)

Source from the content-addressed store, hash-verified

217 * @return 截取后的字符串
218 */
219 public static String rtrim(String str, int num) {
220 if (!isEmpty(str) && str.length() > num) {
221 str = str.substring(0, str.length() - num);
222 }
223 return str;
224 }
225
226 /**
227 * 根据指定的字符把源字符串分割成一个list

Callers 1

testTrimMethod · 0.95

Calls 1

isEmptyMethod · 0.95

Tested by 1

testTrimMethod · 0.76