Files
AIPS/dotnet/AipsCore/Utility/Text/Charset.cs
2026-02-04 21:11:51 +01:00

41 lines
942 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace AipsCore.Utility.Text;
public static class Charset
{
public static char[] GetNumericCharset()
{
var charset = new List<char>();
// 09
for (char c = '0'; c <= '9'; c++)
charset.Add(c);
return charset.ToArray();
}
public static char[] GetLettersCharset()
{
var charset = new List<char>();
// az
for (char c = 'a'; c <= 'z'; c++)
charset.Add(c);
// AZ
for (char c = 'A'; c <= 'Z'; c++)
charset.Add(c);
return charset.ToArray();
}
public static char[] GetAlphanumericCharset()
{
var lettersCharset = GetLettersCharset();
var numericCharset = GetNumericCharset();
char[] alphanumericCharset = [..numericCharset, ..lettersCharset];
return alphanumericCharset;
}
}