Esempio n. 1
0
 public string getNewSpelling(int year, string phrase)
 {
     Years y = new Years();
     if (year == 0)
         return phrase;
     string[] p = phrase.Split(' ');
     switch (year)
     {
         case 1:
             y.Year1(p);
             break;
         case 2:
             y.Year1(p);
             y.Year2(p);
             break;
         case 3:
             y.Year1(p);
             y.Year2(p);
             y.Year3(p);
             break;
         case 4:
             y.Year1(p);
             y.Year2(p);
             y.Year3(p);
             y.Year4(p);
             break;
         case 5:
             y.Year1(p);
             y.Year2(p);
             y.Year3(p);
             y.Year4(p);
             y.Year5(p);
             break;
         case 6:
             y.Year1(p);
             y.Year2(p);
             y.Year3(p);
             y.Year4(p);
             y.Year5(p);
             y.Year6(p);
             break;
         case 7:
             y.Year1(p);
             y.Year2(p);
             y.Year3(p);
             y.Year4(p);
             y.Year5(p);
             y.Year6(p);
             y.Year7(p);
             break;
     }
     string result = "";
     for (int i = 0; i < p.Length; i++)
     {
         result += p[i] + " ";
     }
     result = result.Remove(result.Length - 1, 1);
     return result;
 }
Esempio n. 2
0
        public string getNewSpelling(int year, string phrase)
        {
            Years y = new Years();

            if (year == 0)
            {
                return(phrase);
            }
            string[] p = phrase.Split(' ');
            switch (year)
            {
            case 1:
                y.Year1(p);
                break;

            case 2:
                y.Year1(p);
                y.Year2(p);
                break;

            case 3:
                y.Year1(p);
                y.Year2(p);
                y.Year3(p);
                break;

            case 4:
                y.Year1(p);
                y.Year2(p);
                y.Year3(p);
                y.Year4(p);
                break;

            case 5:
                y.Year1(p);
                y.Year2(p);
                y.Year3(p);
                y.Year4(p);
                y.Year5(p);
                break;

            case 6:
                y.Year1(p);
                y.Year2(p);
                y.Year3(p);
                y.Year4(p);
                y.Year5(p);
                y.Year6(p);
                break;

            case 7:
                y.Year1(p);
                y.Year2(p);
                y.Year3(p);
                y.Year4(p);
                y.Year5(p);
                y.Year6(p);
                y.Year7(p);
                break;
            }
            string result = "";

            for (int i = 0; i < p.Length; i++)
            {
                result += p[i] + " ";
            }
            result = result.Remove(result.Length - 1, 1);
            return(result);
        }