AgaHackTools.Main.Default.Pattern.MaskFromPattern C# (CSharp) Метод

MaskFromPattern() публичный статический Метод

Creates a mask from a given pattern, using the given chars
public static MaskFromPattern ( byte pattern, byte wildcardByte, char wildcardChar = '?', char matchChar = 'x' ) : string
pattern byte The pattern this functions designs a mask for
wildcardByte byte Byte that is interpreted as a wildcard
wildcardChar char Char that is used as wildcard
matchChar char Char that is no wildcard
Результат string
        public static string MaskFromPattern(byte[] pattern, byte wildcardByte =0, char wildcardChar = '?', char matchChar = 'x')
        {
            char[] chr = new char[pattern.Length];
            for (int i = 0; i < chr.Length; i++)
                chr[i] = pattern[i] == wildcardByte ? wildcardChar : matchChar;
            return new string(chr);
        }