我的毕设浮动车数据的仿真模拟,浮动车数据,呵呵,我也是服了,1M的数据有500kb是脏数据。
处理这些脏数据也是让我头疼,用到各种的数据类型转化,用一次、查一次、忘一次,太j8浪费时间,所以总结一下喽。
1.byte数组转化为字符串
byte[] sb=new byte[20];
String s=new String(sb);
2.字符串转化为byte数组
String s=new String();
byte[] sb=s.getBytes();
3.字符串合并
String s1=new String();
String s2=new String();
String s3=s1+s2;
4.字符串转化为整型
String s="111";
int i=Integer.parseInt(s);
5.整型转化为字符串
String ss=Integer.toString(i);
或
String sss=String.valueOf(i);
先到这里吧,遇到别的在添加