这是我做的一个小例子
不过我的系统是日文的,所以不能写中文,不过原理是一样的
你看看把
这边个程序主要是把日文从一个字符串中提取出来
public class WordTest {
public static void main(String[] args) {
String strTest = "123画asdfさす画工";
String karactor ="";
String word = "";
String temp;
byte[] btest;
for(int i = 0; i<strTest.length();i++){
temp = strTest.substring(i,i+1);
btest = temp.getBytes();
if(btest.length==1)
karactor = karactor + temp;
else
word = word + temp;
}
System.out.println(karactor);
System.out.println(word);
}
}
不过我的系统是日文的,所以不能写中文,不过原理是一样的
你看看把
这边个程序主要是把日文从一个字符串中提取出来
public class WordTest {
public static void main(String[] args) {
String strTest = "123画asdfさす画工";
String karactor ="";
String word = "";
String temp;
byte[] btest;
for(int i = 0; i<strTest.length();i++){
temp = strTest.substring(i,i+1);
btest = temp.getBytes();
if(btest.length==1)
karactor = karactor + temp;
else
word = word + temp;
}
System.out.println(karactor);
System.out.println(word);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货