Solved

Randomize Order Of Numbers

Posted on 2011-03-16
4
341 Views
Last Modified: 2012-05-11
Hi.

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#?

thanks.
0
Comment
Question by:freezingHot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 35148009
C# Randomize Chars in String
http://www.dotnetperls.com/randomize-string
0
 
LVL 1

Author Closing Comment

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

Expert Comment

by:athomsfere
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.
0
 
LVL 1

Author Comment

by:freezingHot
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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