Here you can find the source of halfWidthToFullWidth(String s)
public static String halfWidthToFullWidth(String s)
//package com.java2s; public class Main { public static String halfWidthToFullWidth(String s) { if (isEmpty(s)) { return s; }// w ww . j a v a2 s. c om char[] source = s.toCharArray(); for (int i = 0; i < source.length; i++) { if (source[i] == ' ') { source[i] = (char) 12288; // } else if (source[i] == '.') { // source[i] = (char)12290; } else if (source[i] >= 33 && source[i] <= 126) { source[i] = (char) (source[i] + 65248); } else { source[i] = source[i]; } } return new String(source); } /** * is null or its length is 0 * * <pre> * isEmpty(null) = true; * isEmpty("") = true; * isEmpty(" ") = false; * </pre> * * @param str * @return if string is null or its size is 0, return true, else return false. */ public static boolean isEmpty(String str) { return (str == null || str.length() == 0); } }