public class FullCharUtil extends Object
| Constructor and Description |
|---|
FullCharUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
countHalf(@Nullable CharSequence str) |
static @NotNull String |
leftCut(@Nullable CharSequence str,
int count)
从左侧截取N个汉字长度的字符(英文算1,汉字算2)
|
static @NotNull String |
leftCut(@Nullable CharSequence str,
int count,
int off)
从左侧截取N个汉字长度的字符(英文算1,汉字算2)
|
static @NotNull String |
rightCut(@Nullable CharSequence str,
int count)
从右侧截取N个汉字长度的字符(英文算1,汉字算2)
|
static @NotNull String |
rightCut(@Nullable CharSequence str,
int count,
int off)
从右侧截取N个汉字长度的字符(英文算1,汉字算2)
|
@NotNull public static @NotNull String leftCut(@Nullable @Nullable CharSequence str, int count)
str - 文字count - 汉字长度@NotNull public static @NotNull String leftCut(@Nullable @Nullable CharSequence str, int count, int off)
str - 文字count - 汉字长度off - 左侧字符偏移量(不管汉字还是半角)@NotNull public static @NotNull String rightCut(@Nullable @Nullable CharSequence str, int count)
str - 文字count - 汉字长度@NotNull public static @NotNull String rightCut(@Nullable @Nullable CharSequence str, int count, int off)
str - 文字count - 汉字长度off - 右侧字符偏移量(不管汉字还是半角)public static int countHalf(@Nullable
@Nullable CharSequence str)
Copyright © 2020. All rights reserved.