hideNumber static method

String hideNumber(
  1. String? phoneNo, {
  2. int start = 3,
  3. int end = 7,
  4. String replacement = '****',
})

隐藏手机号中间n位

Implementation

static String hideNumber(String? phoneNo,
    {int start = 3, int end = 7, String replacement = '****'}) {
  if (isEmpty(phoneNo)) {
    return "";
  }
  return phoneNo!.replaceRange(start, end, replacement);
}