public class StrTrimer extends Object implements UnaryOperator<CharSequence>, Serializable
null
,依然返回null
。Modifier and Type | Class and Description |
---|---|
static class |
StrTrimer.TrimMode
去除模式
|
Modifier and Type | Field and Description |
---|---|
static StrTrimer |
TRIM_BLANK
去除两边空白符
|
static StrTrimer |
TRIM_PREFIX_BLANK
去除头部空白符
|
static StrTrimer |
TRIM_SUFFIX_BLANK
去除尾部空白符
|
Constructor and Description |
---|
StrTrimer(StrTrimer.TrimMode mode,
Predicate<Character> predicate)
构造
|
Modifier and Type | Method and Description |
---|---|
String |
apply(CharSequence str) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
identity
public static final StrTrimer TRIM_BLANK
public static final StrTrimer TRIM_PREFIX_BLANK
public static final StrTrimer TRIM_SUFFIX_BLANK
public StrTrimer(StrTrimer.TrimMode mode, Predicate<Character> predicate)
mode
- 去除模式,可选去除头部、尾部、两边predicate
- 断言是否过掉字符,返回true
表述过滤掉,false
表示不过滤public String apply(CharSequence str)
apply
in interface Function<CharSequence,CharSequence>
Copyright © 2025. All rights reserved.