14 lines
457 B
C#
14 lines
457 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace LCU.API.Internal.Operations.IncentiveApiLib.Services;
|
|
|
|
public static class DataCleaningService
|
|
{
|
|
public static string CleanedPhoneNumber(string input)
|
|
{
|
|
var cleanPhoneNumber = input == null ? string.Empty : Regex.Replace(input, @"\D", string.Empty);
|
|
cleanPhoneNumber = cleanPhoneNumber.Length == 11 ? cleanPhoneNumber[1..] : cleanPhoneNumber;
|
|
return cleanPhoneNumber;
|
|
}
|
|
}
|