admin
2023-10-08 2c5b6e472c368e80d85b8ea2b461c9ea62981d9b
library-APPUpdate/src/com/yeshi/appupdate/util/StringUtils.java
@@ -13,7 +13,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
import android.telephony.TelephonyManager;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
@@ -170,7 +170,7 @@
   /**
    * is null or its length is 0 or it is made by space
    *
    *
    * @param str
    * @return if string is null or its size is 0 or it is made by space, return
    *         true, else return false.
@@ -181,7 +181,7 @@
   /**
    * is null or its length is 0
    *
    *
    * @param str
    * @return if string is null or its size is 0, return true, else return
    *         false.
@@ -192,7 +192,7 @@
   /**
    * compare two string
    *
    *
    * @param actual
    * @param expected
    * @return
@@ -204,7 +204,7 @@
   /**
    * capitalize first letter
    *
    *
    * <pre>
    * capitalizeFirstLetter(null)     =   null;
    * capitalizeFirstLetter("")       =   "";
@@ -213,7 +213,7 @@
    * capitalizeFirstLetter("ab")     =   "Ab"
    * capitalizeFirstLetter("Abc")    =   "Abc"
    * </pre>
    *
    *
    * @param str
    * @return
    */
@@ -224,8 +224,8 @@
      char c = str.charAt(0);
      return (!Character.isLetter(c) || Character.isUpperCase(c)) ? str
            : new StringBuilder(str.length())
                  .append(Character.toUpperCase(c))
                  .append(str.substring(1)).toString();
            .append(Character.toUpperCase(c))
            .append(str.substring(1)).toString();
   }
@@ -233,8 +233,8 @@
      if (text == null || text.length() == 0) {
         return false;
      }
        try {
            Integer.parseInt(text);
      try {
         Integer.parseInt(text);
         return true;
      } catch (Exception e) {
         return false;
@@ -253,7 +253,7 @@
   /**
    * 是否是正确的电话号码
    *
    *
    * @param mobile
    * @return
    */
@@ -364,7 +364,7 @@
   /**
    * 身份证验�?
    *
    *
    * @param card
    * @return
    */
@@ -449,7 +449,7 @@
   }
   public static void getdiffrentColor(TextView tv, int color, int start,
         int end) {
                              int end) {
      SpannableStringBuilder style = new SpannableStringBuilder(tv.getText());
      ForegroundColorSpan redSpan = new ForegroundColorSpan(color);
      style.setSpan(redSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
@@ -457,7 +457,7 @@
   }
   public static void getdiffrentColor(TextView tv, int color, int size,
         int start, int end) {
                              int start, int end) {
      SpannableStringBuilder style = new SpannableStringBuilder(tv.getText());
      ForegroundColorSpan redSpan = new ForegroundColorSpan(color);
      style.setSpan(redSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);