title: Why can't I set the index value of the loop algorithm?
body: <p>So, basically I am practicing some algorithms. And I am trying to figure out why the following code is giving me an error when I try to set the value of number[i]? I know it is probably simple but I don't 'why' it does not work.</p>
  
  <pre><code>public int SumOfRandomNumbersWithStrings(string randomness)
  {
      //Get the value of each index in the array
      string number = "";
      for (int i = 0; i &lt; randomness.Length; i++)
      {
          number[i] = randomness[i];
      }
      //temporarily one until I finish the algorithm
      return 1;
  }
  </code></pre>