Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:13:53+00:00 2026-05-26T15:13:53+00:00

This question is about this topic: Vb.net all combinations Question: I use this code

  • 0

This question is about this topic:
Vb.net all combinations

Question:
I use this code for my application but i’ve got a problem.
The chance exists that i have much items which has to be combinated.

But i just want to show the first 10 combinations/results.

What i want is the text to be completely unique.

so the example at my topic you see in the beginning of this question there’s an ape cow deer … example.
It doesn’t matter here.

but if i got something like this:

  • 1|2|3|4|5
  • 6|7|8|9
  • 3|2|1
  • 0|9|8|7|6|5

( sometimes it’s even bigger )

the first 10 results are:

  • 1-6-3-0
  • 1-6-3-9
  • 1-6-3-8
  • 1-6-3-7
  • 1-6-3-6
  • 1-6-3-5
  • 1-6-2-0
  • 1-6-2-9
  • 1-6-2-8
  • 1-6-2-7

but they are almost the same.

i want the first 10 results to be something like this then:

  • 1-8-1-6
  • 3-6-1-5
  • 4-8-3-0
  • etc…

Is this possible??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:13:53+00:00Added an answer on May 26, 2026 at 3:13 pm

    Here is my solution that I converted from c# using http://www.developerfusion.com/tools/convert/csharp-to-vb/:

    Dim numbers = New Integer()() { _
        New Integer() {1, 2, 3, 4, 5}, _
        New Integer() {6, 7, 8, 9}, _
        New Integer() {3, 2, 1}, _
        New Integer() {0, 9, 8, 7, 6, 5} _
    }
    Dim random = New Random()
    Dim codes = New HashSet(Of String)()
    Dim newCode As String
    
    For resultNr As Integer = 0 To 9
        ' Try to generate random codes until a non exisiting one is found.
        Do
            Dim sb = New StringBuilder()
            For i As Integer = 0 To 3
                Dim r As Integer = random.[Next](numbers(i).Length)
                sb.Append(numbers(i)(r)).Append("-")
            Next
            sb.Length -= 1
            newCode = sb.ToString()
        Loop While codes.Contains(newCode)
        codes.Add(newCode)
        Console.WriteLine(newCode)
    Next
    Console.ReadKey()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked a question about Garbage Collection in Java in this topic . But
This question about Timers for windows services got me thinking: Say I have (and
Followed this question about delayed_job and monit Its working on my development machine. But
Follow up to this question about GNU make : I've got a directory, flac
I have a question about this question . I posted a reply there but
I got a problem with a system running on ASP.NET 1.1. It's a topic
This is my second question about this topic, the original question can be found
I know there was already a question about this topic (cleanest way to add
I hope this question is still on topic, but recently I found a key-value
This question is a follow up to my previous question about getting the HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.