C# List中随机获取N个字符

  static void Main(string[] args)
         {
             List<string> strList = new List<string>();
             ; i <= ; i++)
             {
                 strList.Add("string "+i);
             }
             ;
             if (strList.Count < number)
             {
                 number = strList.Count;
             }

             ;
             List<string> resultList = new List<string>();
             ; i <= number; i++)
             {
                 int rang = strList.Count - i;
                 , rang);
                 //Console.WriteLine("ramg:" + rang + "  strList[" + index + "]:" + strList[index]);
                 resultList.Add(strList[index]);
                 strList[index] = strList[rang];
                 count++;
             }
             Console.WriteLine("---------COUNT: " + count);
             foreach (var result in resultList)
             {
                 Console.WriteLine(result);
             }

             Console.ReadLine();

         }
上一篇:JAVA课程之简易课程登记


下一篇:关于applicationx/www-form-urlencoded和multipart/form-data的描述