Ejemplo n.º 1
0
        public static long LunghezzaResistente()
        {
            string lines            = Metodi.LetturaResistente();
            long   resistentelength = lines.Length;

            return(resistentelength);
        }
Ejemplo n.º 2
0
        //LUNGHEZZA
        public static long LunghezzaSensibile()
        {
            string lines           = Metodi.LetturaSensibile();
            long   sensibilelength = lines.Length;

            return(sensibilelength);
        }
Ejemplo n.º 3
0
        //PORZIONE UGUALE
        public static string PorzioneUguale()
        {
            string sensibile  = Metodi.LetturaSensibile();
            string resistente = Metodi.LetturaResistente();
            long   posizione  = Metodi.CarattereDiverso();
            string uguale     = "";

            for (int i = 0; i < posizione; i++)
            {
                uguale += sensibile[i];
            }
            return(uguale);
        }
Ejemplo n.º 4
0
        //POSIZIONE DIFFERENZA
        public static int CarattereDiverso()
        {
            string sensibile  = Metodi.LetturaSensibile();
            string resistente = Metodi.LetturaResistente();

            for (int i = 0; i < Math.Min(sensibile.Length, resistente.Length); i++)
            {
                if (sensibile[i] != resistente[i])
                {
                    return(i);
                }
            }
            return(-1);
        }
Ejemplo n.º 5
0
        //NUMERO CARATTERI DIFFERENTI
        public static int DifferenzeStringhe()
        {
            string sensibile  = Metodi.LetturaSensibile();
            string resistente = Metodi.LetturaResistente();
            int    differenze = 0;

            for (int i = 0; i < Math.Min(sensibile.Length, resistente.Length); i++)
            {
                if (sensibile[i] != resistente[i])
                {
                    differenze++;
                }
            }
            return(differenze);
        }