Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Arrange 4561 to 1456 in VB?

any one know how i can rearrange numbers in say 45893 to an order from smallest to biggest in VB as 34589 or

1555221 as 1122555

1 Answer

Relevance
  • MarkG
    Lv 7
    9 years ago
    Favorite Answer

    Private Sub Button1_Click(ByVal sender As System.Object, _

    ByVal e As System.EventArgs) _

    Handles Button1.Click

    Dim str As String = "4561"

    Dim sortedString As String = ""

    Dim myChrs() As Char = str.ToCharArray

    Array.Sort(myChrs)

    For Each element As Char In myChrs

    sortedString = sortedString & element

    Next

    MessageBox.Show(sortedString)

    End Sub

Still have questions? Get your answers by asking now.