|
@@ -398,13 +398,13 @@ namespace Masuit.Tools
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
public static string MaskEmail(this string s, char mask = '*')
|
|
public static string MaskEmail(this string s, char mask = '*')
|
|
{
|
|
{
|
|
- var index = s.LastIndexOf("@");
|
|
|
|
- var oldValue = s.Substring(0, index);
|
|
|
|
if (!MatchEmail(s).isMatch)
|
|
if (!MatchEmail(s).isMatch)
|
|
{
|
|
{
|
|
return s;
|
|
return s;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var index = s.LastIndexOf("@");
|
|
|
|
+ var oldValue = s.Substring(0, index);
|
|
var newValue = Mask(oldValue, mask);
|
|
var newValue = Mask(oldValue, mask);
|
|
return newValue + s.Substring(index, s.Length - index);
|
|
return newValue + s.Substring(index, s.Length - index);
|
|
}
|
|
}
|