26 lines
696 B
C#
26 lines
696 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace PARR.EsppSync.Helpers
|
|
{
|
|
/// <summary>
|
|
/// Хелперы для EsppSync
|
|
/// </summary>
|
|
public static class EsppSyncHelpers
|
|
{
|
|
/// <summary>
|
|
/// Првести строку в стандарт сравнения (для сравнения объектов)
|
|
/// </summary>
|
|
/// <param name="str"></param>
|
|
/// <returns></returns>
|
|
public static string Normalize(string? str)
|
|
{
|
|
if (str == null)
|
|
return string.Empty;
|
|
|
|
str = Regex.Replace(str, @"\s+", string.Empty);
|
|
|
|
return str.Trim().ToLowerInvariant();
|
|
}
|
|
}
|
|
}
|