System.Text.ASCIIEncoding.GetChars C# (CSharp) Метод

GetChars() приватный Метод

private GetChars ( byte bytes, int byteCount, char chars, int charCount ) : int
bytes byte
byteCount int
chars char
charCount int
Результат int
        public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount)
        {
            throw null;
        }

Same methods

ASCIIEncoding::GetChars ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex ) : int

Usage Example

Пример #1
0
        static public bool IsPalindrome(string s)
        {
            char[] alphabet = new char[36];

            System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();

            for (int i = 48; i < 58; i++)
            {
                byte[] byteArray = new byte[] { (byte)i };
                alphabet[i - 48] = asciiEncoding.GetChars(byteArray)[0];
            }

            for (int i = 97; i < 123; i++)
            {
                byte[] byteArray = new byte[] { (byte)i };
                alphabet[i + 10 - 97] = asciiEncoding.GetChars(byteArray)[0];
            }

            char[] c = s.ToLower().ToCharArray();

            var filer = c.Where(w => alphabet.Contains(w)).ToArray();

            for (int i = 0; i < filer.Length / 2; i++)
            {
                if (filer[i] != filer[filer.Length - 1 - i])
                {
                    return(false);
                }
            }

            return(true);
        }
All Usage Examples Of System.Text.ASCIIEncoding::GetChars