先下载:http://pinyin4j.sourceforge.net/
public class CnToPy {
//将汉字转换为全拼
public static String getPingYin(String src){
char[] t1 = null;
t1=src.toCharArray();
String[] t2 = new String[t1.length];
HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();
t3.setCaseType(Ha ...
public static String addDate(String day,int x)
{
Date date = null;
try
{
date = sdf.parse(day);
}
catch (ParseException ex)
{
ex.printStackTrace();
}
if (date==null) return "";
...
1用JAVA自带的函数
public static boolean isNumeric(String str){
for (int i = str.length();--i>=0;){
if (!Character.isDigit(str.charAt(i))){
return false;
}
}
return true;
}
2用正则表达式
public static boolean isNumeric(String str){
Pattern pattern = Pattern.compile("[0-9]*");
ret ...
- 浏览: 21245 次
- 性别:

- 来自: 青岛

- 详细资料
搜索本博客
我的相册
111 046
共 4 张
共 4 张
最近加入圈子
最新评论
-
JAVA数据类型转换
谢谢楼主,说的很详细,好好学习下!
-- by sky21 -
JAVA数据类型转换
虽然是基础的东西, 但能总结出来还不错, 虽然有某些欠缺
-- by zhanjia -
15位和18位身份证的正则表 ...
不错,我收藏了
-- by jasongreen -
15位和18位身份证的正则表 ...
不错,我收藏了
-- by jasongreen -
DOS中 Orcle9i服务的启动 ...
呵呵
-- by jiake0504






评论排行榜