public static String nullToSpace(Object src){
if (src == null)
return "";
return src.toString();
}
/*************/
public static boolean IsNull(Object obj){
return (obj==null)?true:false;
}
/**********************/
public static String replaceSpaceToNBSP(String src) {
src = rtrim(src);
//src.replaceAll(" ", " ");
int cur=0,cnt,i;
String out="";
char val[] = src.toCharArray();
for (i = 0, cnt = val.length; i < cnt; i++) {
if (val[i] == ' ') {
if (cur<=i) {
out=out+src.substring(cur,i)+ " ";
} else {
out=out+ " ";
}
cur=i+1;
}
}
if (cur < cnt){
out=out+src.substring(cur,cnt);
}
return out;
}
/***
*
* 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday
*/
public static int getDay(int year, int month, int date){
Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, date);
return cal.get(Calendar.DAY_OF_WEEK);
}