MCPcopy Create free account
hub / github.com/SeanDragon/protools / toSBC

Method toSBC

common/src/main/java/pro/tools/data/text/ToolStr.java:317–332  ·  view source on GitHub ↗

转化为全角字符 @param s 待转字符串 @return 全角字符串

(String s)

Source from the content-addressed store, hash-verified

315 * @return 全角字符串
316 */
317 public static String toSBC(String s) {
318 if (isEmpty(s)) {
319 return s;
320 }
321 char[] chars = s.toCharArray();
322 for (int i = 0, len = chars.length; i < len; i++) {
323 if (chars[i] == ' ') {
324 chars[i] = (char) 12288;
325 } else if (33 <= chars[i] && chars[i] <= 126) {
326 chars[i] = (char) (chars[i] + 65248);
327 } else {
328 chars[i] = chars[i];
329 }
330 }
331 return new String(chars);
332 }
333
334 /**
335 * 将带(下划线)_的字符串格式化驼峰命名法

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected