16 lines
388 B
C#
16 lines
388 B
C#
// Copyright (c) 2020 Tudor Stanciu
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace Tuitio.Domain.Helpers
|
|
{
|
|
internal static class DataValidationHelper
|
|
{
|
|
public static bool StringIsBase64(string str)
|
|
{
|
|
str = str.Trim();
|
|
return (str.Length % 4 == 0) && Regex.IsMatch(str, @"^[a-zA-Z0-9+/]*={0,3}$", RegexOptions.None);
|
|
}
|
|
}
|
|
}
|