Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,990 questions

51,935 answers

573 users

How to create 2 letters permutation from A, B, C, and D in VB.NET

1 Answer

0 votes
Imports System

' In a combination, the subset elements can be listed in any order.

Public Class TwoLettersCombinationFromABCD_VB_NET
    Public Shared Sub create_2_letters_combination(ByVal letters As Char())
        Dim size As Integer = letters.Length

        For i As Integer = 0 To size - 1
            For j As Integer = i + 1 To size - 1
				Console.WriteLine("{0}{1}", letters(i), letters(j))
            Next
        Next
    End Sub

    Public Shared Sub Main(ByVal args As String())
        Dim letters As Char() = New Char() {"A"c, "B"c, "C"c, "D"c}

        create_2_letters_combination(letters)
    End Sub
End Class



' run:
'
' AB
' AC
' AD
' BC
' BD
' CD
'

 



answered Nov 9, 2024 by avibootz

Related questions

...