khideNumber method

String? khideNumber({
  1. int start = 3,
  2. int end = 7,
  3. String replace = '****',
})

隐藏中间n位

    '16657135763'.khideNumber() => 166****5763

Implementation

String? khideNumber(
    {int start = 3, int end = 7, String replace = '****'}) {
  var file = this;
  if (file == null) return null;
  return file.replaceRange(start, end, replace);
}