java吧 关注:1,242,819贴子:12,718,367
  • 8回复贴,共1

求大佬帮我解决难题,困扰我一个

只看楼主收藏回复

求大佬帮我解决难题,困扰我一个星期了




来自Android客户端1楼2017-09-22 10:14回复
    public String toString(int val, int type) {
    switch(type) {
    case 2:
    return Integer.toBinaryString(Integer.valueOf(val));
    case 8:
    return Integer.toOctalString(Integer.valueOf(val));
    case 16:
    return Integer.toHexString(Integer.valueOf(val));
    default:
    return "只支持2进制8进制和16进制";
    }
    }


    IP属地:陕西3楼2017-09-22 10:50
    回复
      感谢


      来自Android客户端4楼2017-09-22 10:52
      回复
        public static String getSysDate() {
        Date d = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 hh点mm分ss秒");
        return sdf.format(d);
        }


        IP属地:陕西5楼2017-09-22 10:56
        回复
          工具类都百度得到


          IP属地:广东6楼2017-09-22 11:04
          收起回复
            public static boolean matchIDCard(String id) {
            return id.matches("[1-9]{1}[0-9]{9}[1]{1}[0]{2}[1]{1}[0-9]{3}[0-9xX]{1}");
            }


            IP属地:陕西7楼2017-09-22 11:09
            回复