using System;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static Random _random = new Random();
// Fisher-Yates shuffle
static string Shuffle<T>(T[] array)
{
int n = array.Length;
for (int i = 0; i < n; i++)
{
int rand = i + _random.Next(n - i);
T temp = array[rand];
array[rand] = array[i];
array[i] = temp;
}
return string.Join("", array);
}
static void Main()
{
const string str = "Obi-Wan Kenobi, You’re my only hope";
string rand_str = Shuffle(str.ToCharArray());
Console.WriteLine(rand_str);
}
}
}
/*
run:
Who b'biaeoe-yon,rKnloYup i yeOmn
*/