package com.chenyang.nse.bussiness.tools.number;

public class MobileNumberTool {
   public static String getMobilePrefix() {
      String s = null;
      String[] var10000 = new String[]{"130", "132", "135", "136", "138", "139", "188", "189", "159"};
      int prefix = IntegerTool.randomInt(0, 8);
      s = String.valueOf(prefix);
      return s;
   }

   public static String toHalfAngleDigital(String input) {
      char[] c = input.toCharArray();

      for(int i = 0; i < c.length; ++i) {
         if (c[i] == 12288) {
            c[i] = ' ';
         } else if (c[i] > '\uff00' && c[i] < '｟') {
            c[i] -= 'ﻠ';
         }
      }

      String returnString = new String(c);
      return returnString;
   }

   public static String toAngleDigital(String input) {
      char[] c = input.toCharArray();

      for(int i = 0; i < c.length; ++i) {
         if (c[i] == ' ') {
            c[i] = 12288;
         } else if (c[i] < 127) {
            c[i] += 'ﻠ';
         }
      }

      return new String(c);
   }

   public static void main(String[] args) {
      String str = "1234567890-+()１２３４５６７８９０－＋（）";
      System.out.println(">>>>>>>>>>>toHalfAngleDigital before: " + str);
      String halfAngleStr = toHalfAngleDigital(str);
      System.out.println(">>>>>>>>>>>toHalfAngleDigital after: " + halfAngleStr);
      str = "13842060853-3160331";
      halfAngleStr = toAngleDigital(str);
      System.out.println(">>>>>>>>>>>toAngleDigital after: " + halfAngleStr);
   }
}
