Randomize
method (from another SO question):
public static T[] Randomize(T[] source)
{
List randomized = new List();
List original = new List(source);
Random r = new Random();
for (int size = original.Count; size > 0; size--)
{
int index = r.Next(size);
randomized.Add(original[index]);
original[index] = original[size - 1];
}
return randomized.ToArray();
}
And usage:
string text = "Line";
string randomized = new string(Randomize(text.ToCharArray()));