-
lib
-
Convert samples
import com.spreada.utils.chinese.ZHConverter; public class ChineseStringConverter { /** * Convert Simplified String to Traditional String * * @param simplifiedStr * Simplified String * @return Traditional String */ public static String SimToTra(String simplifiedStr) { ZHConverter converter = ZHConverter.getInstance(ZHConverter.TRADITIONAL); String traditionalStr = converter.convert(simplifiedStr); return traditionalStr; } /** * Convert Traditional String to Simplified String * * @param traditionalStr * Traditional String * @return Simplified String */ public static String TraToSim(String traditionalStr) { ZHConverter converter = ZHConverter.getInstance(ZHConverter.SIMPLIFIED); String simplifiedStr = converter.convert(traditionalStr); return simplifiedStr; } }
繁简体中文转换
最新推荐文章于 2021-05-11 11:28:14 发布