28 lines
671 B
C#
28 lines
671 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace 報到系統客戶端
|
|
{
|
|
internal class Utils
|
|
{
|
|
/// <summary>
|
|
/// 手機號轉隱碼輸出(前4後3)
|
|
/// </summary>
|
|
/// <param name="mobile"></param>
|
|
/// <returns></returns>
|
|
public static string HideMobile(string mobile)
|
|
{
|
|
if (string.IsNullOrEmpty(mobile))
|
|
return string.Empty;
|
|
|
|
if (mobile.Length >= 7)
|
|
return mobile.Substring(0, 4) + "***" + mobile.Substring(mobile.Length - 3);
|
|
|
|
return "***";
|
|
}
|
|
}
|
|
}
|