String转化为标准时间
import java.text.SimpleDateFormat;
import java.util.Date;
public Date StringToDate(String time){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-HH");
Date date = sdf.parse(time);
return date;
}
String转化为Ascll 码
public String StringToAscll(String content){
String result="";
int length = content.length;
For(int i=0; i<length; i++){
Char char=content.charAt(i);
int a = (int)char;
result=result + a;
}
return result;
}
两位数前位补0
int length = 5;
String hex=Integer.toHexString(length & 0xff | 0xffffff00).substring(6);