本文整理了Java中cn.hutool.core.util.StrUtil.strBuilder()
方法的一些代码示例,展示了StrUtil.strBuilder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StrUtil.strBuilder()
方法的具体详情如下:
包路径:cn.hutool.core.util.StrUtil
类名称:StrUtil
方法名:strBuilder
[英]创建StrBuilder对象
[中]创建StrBuilder对象
代码示例来源:origin: looly/hutool
/**
* 汉字转拼音
* <hr>
* example : 张三 zhangsan
*
* @param chinese 汉字
* @return 对应的拼音
* @since 4.0.11
*/
public static String getPinYin(String chinese) {
final StrBuilder result = StrUtil.strBuilder();
String strTemp = null;
int len = chinese.length();
for (int j = 0; j < len; j++) {
strTemp = chinese.substring(j, j + 1);
int ascii = getChsAscii(strTemp);
if (ascii > 0) {
//非汉字
result.append((char)ascii);
} else {
for (int i = pinyinValue.length - 1; i >= 0; i--) {
if (pinyinValue[i] <= ascii) {
result.append(pinyinStr[i]);
break;
}
}
}
}
return result.toString();
}
代码示例来源:origin: looly/hutool
/**
* 汉字转拼音
* <hr>
* example : 张三 zhangsan
*
* @param chinese 汉字
* @return 对应的拼音
* @since 4.0.11
*/
public static String getPinYin(String chinese) {
final StrBuilder result = StrUtil.strBuilder();
String strTemp = null;
int len = chinese.length();
for (int j = 0; j < len; j++) {
strTemp = chinese.substring(j, j + 1);
int ascii = getChsAscii(strTemp);
if (ascii > 0) {
//非汉字
result.append((char)ascii);
} else {
for (int i = pinyinValue.length - 1; i >= 0; i--) {
if (pinyinValue[i] <= ascii) {
result.append(pinyinStr[i]);
break;
}
}
}
}
return result.toString();
}
代码示例来源:origin: looly/hutool
int length = expression.length();
final StrBuilder builder = StrUtil.strBuilder();
char c;
boolean isNumStart = false;// 下标标识符开始
代码示例来源:origin: looly/hutool
int length = expression.length();
final StrBuilder builder = StrUtil.strBuilder();
char c;
boolean isNumStart = false;// 下标标识符开始
代码示例来源:origin: looly/hutool
int len = namedSql.length();
final StrBuilder name = StrUtil.strBuilder();
final StrBuilder sqlBuilder = StrUtil.strBuilder();
char c;
Character nameStartChar = null;
代码示例来源:origin: looly/hutool
int len = namedSql.length();
final StrBuilder name = StrUtil.strBuilder();
final StrBuilder sqlBuilder = StrUtil.strBuilder();
char c;
Character nameStartChar = null;
代码示例来源:origin: cn.hutool/hutool-all
/**
* 汉字转拼音
* <hr>
* example : 张三 zhangsan
*
* @param chinese 汉字
* @return 对应的拼音
* @since 4.0.11
*/
public static String getPinYin(String chinese) {
final StrBuilder result = StrUtil.strBuilder();
String strTemp = null;
int len = chinese.length();
for (int j = 0; j < len; j++) {
strTemp = chinese.substring(j, j + 1);
int ascii = getChsAscii(strTemp);
if (ascii > 0) {
//非汉字
result.append((char)ascii);
} else {
for (int i = pinyinValue.length - 1; i >= 0; i--) {
if (pinyinValue[i] <= ascii) {
result.append(pinyinStr[i]);
break;
}
}
}
}
return result.toString();
}
代码示例来源:origin: cn.hutool/hutool-all
int length = expression.length();
final StrBuilder builder = StrUtil.strBuilder();
char c;
boolean isNumStart = false;// 下标标识符开始
代码示例来源:origin: cn.hutool/hutool-all
int len = namedSql.length();
final StrBuilder name = StrUtil.strBuilder();
final StrBuilder sqlBuilder = StrUtil.strBuilder();
char c;
Character nameStartChar = null;
代码示例来源:origin: cn.hutool/hutool-db
int len = namedSql.length();
final StrBuilder name = StrUtil.strBuilder();
final StrBuilder sqlBuilder = StrUtil.strBuilder();
char c;
Character nameStartChar = null;
内容来源于网络,如有侵权,请联系作者删除!