title: How to scramble string C#?
body: <p>I write the code to scramble word I am create simple game jumble</p>
  
  <pre><code>         string jumble = theWord;
           int length = jumble.Count();
           for (int i = 0; i &lt; length; ++i)
           {
               int index1 = (rand.Next() % length);
               int index2 = (rand.Next() % length);
  
               char  temp =jumble[index1];
               jumble = jumble.Replace(jumble[index1], jumble[index2]);
               jumble = jumble.Replace(jumble[index1], temp);
  
           }
  </code></pre>
  
  <p>update  the code </p>
  
  <pre><code>         string jumble = theWord;
           int length = jumble.Count();
           for (int i = 0; i &lt; length; ++i)
           {
               int index1 = (rand.Next() % length);
               //int index2 = (rand.Next() % length);
  
           char temp = jumble[index1];
           jumble[i] = jumble[index1 - 1];
           jumble[i] = temp;
  
           }
  </code></pre>
  
  <blockquote>
    <p>Error 1   Property or indexer 'string.this[int]' cannot be assigned to
    -- it is read only</p>
  </blockquote>