• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Randomize Order Of Numbers

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
freezingHot
Asked:
freezingHot
  • 2
1 Solution
 
DhaestCommented:
C# Randomize Chars in String
http://www.dotnetperls.com/randomize-string
0
 
freezingHotAuthor Commented:
short and sweet... thanks for the quick response.
0
 
athomsfereCommented:
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
 
freezingHotAuthor Commented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now