Languages
[Edit]
EN

C# / .NET - random sort array

0 points
Created by:
Barmar
338

In this article, we would like to show you how to sort array in random order working with C#.

Quick solution:

 

Practical example

Edit

In below example, we present how to use OrderBy() method combined with Random.Next() to sort array in random order.

Example output:

References

Edit
  1. Enumerable.OrderBy Method (System.Linq) | Microsoft Docs
  2. Random.Next Method (System) | Microsoft Docs

Alternative titles

  1. C# / .NET - shuffle array
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join