Randomize Order Of Numbers

Posted on 2011-03-16
Last Modified: 2012-05-11

I have a number string that i need to randomize every time.

"0123456789" i need it to randomize the order; ie, "0987234561"

can someone please help me with a solution in c#?

Question by:freezingHot
  • 2
LVL 53

Accepted Solution

Dhaest earned 500 total points
ID: 35148009
C# Randomize Chars in String

Author Closing Comment

ID: 35148028
short and sweet... thanks for the quick response.
LVL 14

Expert Comment

ID: 35148103
Will it always be numbers 0-9?

Is there a reason you want to use that string?

I would think using a random number 0-9 would suffice, and you could use a while (NumberSting < LenthWanted) and append random numbers to the string.

Author Comment

ID: 35148286
yes, i need to randomize the order of the numbers 0-9 each time a form is presented.

the linq solution above is quick and easy.... thanks.

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Aspnet xml 2 36
.xltm file opens as .xlsx file 3 37
Is IHttpActionResult a promise pattern? 2 34
XML & .net 5 19
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now