Published
- 1 min read
validate base64 string c#
The solution for this is noted below
validate base64 string c#
Solution
public static bool IsBase64String(string base64)
{
Span<byte> buffer = new Span<byte>(new byte[base64.Length]);
return Convert.TryFromBase64String(base64, buffer , out int bytesParsed);
}
Try other methods by searching on the site. That is if this doesn’t work