static string Shffule(string str,int blockSize)
{
Random randomIndex= new Random();
for (int indexInString = 0; indexInString < str.Length; indexInString+= blockSize)
{
for (int shufflesInBlock = 0; shufflesInBlock < blockSize; shufflesInBlock++)
{
var firstRandomIndex = randomIndex.Next(indexInString, indexInString + blockSize);
var secondRandomIndex = randomIndex.Next(indexInString, indexInString + blockSize);
//str.Swap(firstRandomIndex, secondRandomIndex);
}
}
return swapedString;
}
there is a lot of ways to swap 2 chars string here so i will leave the string.Swap extension method to u
you can control how many shuffles per block from the nested loop by changing the shufflesInBlock < blockSize condition