本文整理了Java中cn.hutool.core.util.StrUtil.indexOfIgnoreCase()
方法的一些代码示例,展示了StrUtil.indexOfIgnoreCase()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StrUtil.indexOfIgnoreCase()
方法的具体详情如下:
包路径:cn.hutool.core.util.StrUtil
类名称:StrUtil
方法名:indexOfIgnoreCase
[英]指定范围内查找字符串,忽略大小写
StrUtil.indexOfIgnoreCase(null, *, *) = -1
StrUtil.indexOfIgnoreCase(*, null, *) = -1
StrUtil.indexOfIgnoreCase("", "", 0) = 0
StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0
StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2
StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1
StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5
StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1
StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2
StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2
StrUtil.indexOfIgnoreCase("abc", "", 9) = -1
[中]指定范围内查找字符串,忽略大小写
StrUtil.indexOfIgnoreCase(null, *, *) = -1
StrUtil.indexOfIgnoreCase(*, null, *) = -1
StrUtil.indexOfIgnoreCase("", "", 0) = 0
StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0
StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2
StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1
StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5
StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1
StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2
StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2
StrUtil.indexOfIgnoreCase("abc", "", 9) = -1
代码示例来源:origin: looly/hutool
/**
* 指定范围内查找字符串,忽略大小写<br>
*
* <pre>
* StrUtil.indexOfIgnoreCase(null, *, *) = -1
* StrUtil.indexOfIgnoreCase(*, null, *) = -1
* StrUtil.indexOfIgnoreCase("", "", 0) = 0
* StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2
* StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2
* StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2
* StrUtil.indexOfIgnoreCase("abc", "", 9) = -1
* </pre>
*
* @param str 字符串
* @param searchStr 需要查找位置的字符串
* @return 位置
* @since 3.2.1
*/
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) {
return indexOfIgnoreCase(str, searchStr, 0);
}
代码示例来源:origin: looly/hutool
/**
* 指定范围内查找字符串,忽略大小写<br>
*
* <pre>
* StrUtil.indexOfIgnoreCase(null, *, *) = -1
* StrUtil.indexOfIgnoreCase(*, null, *) = -1
* StrUtil.indexOfIgnoreCase("", "", 0) = 0
* StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2
* StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2
* StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2
* StrUtil.indexOfIgnoreCase("abc", "", 9) = -1
* </pre>
*
* @param str 字符串
* @param searchStr 需要查找位置的字符串
* @return 位置
* @since 3.2.1
*/
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) {
return indexOfIgnoreCase(str, searchStr, 0);
}
代码示例来源:origin: looly/hutool
int i = -1;
int pos = 0;
while ((i = StrUtil.indexOfIgnoreCase(unicode, "\\u", pos)) != -1) {
代码示例来源:origin: looly/hutool
int i = -1;
int pos = 0;
while ((i = StrUtil.indexOfIgnoreCase(unicode, "\\u", pos)) != -1) {
代码示例来源:origin: cn.hutool/hutool-all
/**
* 指定范围内查找字符串,忽略大小写<br>
*
* <pre>
* StrUtil.indexOfIgnoreCase(null, *, *) = -1
* StrUtil.indexOfIgnoreCase(*, null, *) = -1
* StrUtil.indexOfIgnoreCase("", "", 0) = 0
* StrUtil.indexOfIgnoreCase("aabaabaa", "A", 0) = 0
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 0) = 2
* StrUtil.indexOfIgnoreCase("aabaabaa", "AB", 0) = 1
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 3) = 5
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", 9) = -1
* StrUtil.indexOfIgnoreCase("aabaabaa", "B", -1) = 2
* StrUtil.indexOfIgnoreCase("aabaabaa", "", 2) = 2
* StrUtil.indexOfIgnoreCase("abc", "", 9) = -1
* </pre>
*
* @param str 字符串
* @param searchStr 需要查找位置的字符串
* @return 位置
* @since 3.2.1
*/
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) {
return indexOfIgnoreCase(str, searchStr, 0);
}
代码示例来源:origin: cn.hutool/hutool-all
int i = -1;
int pos = 0;
while ((i = StrUtil.indexOfIgnoreCase(unicode, "\\u", pos)) != -1) {
代码示例来源:origin: xkcoding/spring-boot-demo
public static OnlineUser create(User user) {
OnlineUser onlineUser = new OnlineUser();
BeanUtil.copyProperties(user, onlineUser);
// 脱敏
onlineUser.setPhone(StrUtil.hide(user.getPhone(), 3, 7));
onlineUser.setEmail(StrUtil.hide(user.getEmail(), 1, StrUtil.indexOfIgnoreCase(user.getEmail(), Consts.SYMBOL_EMAIL)));
return onlineUser;
}
}
内容来源于网络,如有侵权,请联系作者删除!