Exemplo n.º 1
0
        public bool Validacion(ref cls_Palabra_DAL Obj_DAL)
        {
            char[] ch = Obj_DAL.Word.ToCharArray();
            Array.Reverse(ch);
            Obj_DAL.Reverse = new string(ch);

            if (Obj_DAL.Word.Equals(Obj_DAL.Reverse, StringComparison.OrdinalIgnoreCase))
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        protected void Validar_Click(object sender, EventArgs e)
        {
            cls_Palabra_DAL palabra = new cls_Palabra_DAL();

            palabra.Word = word.Value;
            cls_Validar_BLL validar = new cls_Validar_BLL();

            if (validar.Validacion(ref palabra))
            {
                reverse.Value = palabra.Reverse;
                result.Value  = "SI es un Palindromo";
            }
            else
            {
                reverse.Value = palabra.Reverse;
                result.Value  = "NO es un Palindromo";
            }
        }