Example #1
0
        public int LongestLine(string a)
        {
            uString uS = new uString();

            string[] splitted = uS.uSplit(a, '.');
            int      longest  = 0;

            for (int i = 0; i < splitted.Length; i++)
            {
                int ALength = 0;
                for (int j = 0; j < splitted[i].Length; j++)
                {
                    if (splitted[i][j] == ' ' && j == 0)
                    {
                    }
                    else
                    {
                        ALength++;
                    }
                }
                if (longest < ALength)
                {
                    longest = ALength;
                }
            }
            return(longest);
        }
Example #2
0
        public string CRemoveLines(string a, string b)
        {
            uString uS = new uString();

            string[] splitted   = uS.uSplit(a, '.');
            int      checkfinal = 0;

            if (splitted[splitted.Length - 1] == "")
            {
                checkfinal = 1;
            }
            for (int i = 0; i < splitted.Length - checkfinal; i++)
            {
                if (splitted[i][0] == ' ')
                {
                    splitted[i].Remove(0);
                }
            }
            int MasLength = 0;

            for (int i = 0; i < splitted.Length - checkfinal; i++)
            {
                if (splitted[i] == b || splitted[i] == " " + b)
                {
                    MasLength += 1;
                }
            }
            int count = 0;

            int[] ToDelete = new int[MasLength];
            for (int i = 0; i < splitted.Length; i++)
            {
                if (splitted[i] == b || splitted[i] == " " + b)
                {
                    ToDelete[count] = i;
                    count++;
                }
            }
            string ToReturn = uS.RemoveElements(splitted, ToDelete);

            return(ToReturn);
        }