Array Hack

  • 3169
  • 0
  • C#
  • 2013-06-15

摘要:[C#]Array Hack

           

       
       string[] x = new string[6];

        //原始
        for (int i=0; i <= x.Length; i++) { 
        
        }
        
        //改成如下
        int j = x.Length;
        for (int i = 0; i <= j; i++)
        {

        }

 

 

    
     //原始
     string[] x = new string[100];


      //改成
       string[] x = new string['d'];