Bubble Sorting Words Alphabetically-VBForums
Results 1 to 4 of 4

Thread: Bubble Sorting Words Alphabetically

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011

    Bubble Sorting Words Alphabetically

    Hello i have a few names in a list box (string).
    How do i use bubble sorting to sort them in alphabetical order.

    Any help is appreciated

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Inside the CPU...

    Re: Bubble Sorting Words Alphabetically

    Function Sort(ByVal list() as String)
        Dim temp as String
        For x = UBound(list) - 1 to 0 step - 1
            For y = 0 to x - 1
             If list(y) > list(y + 1) then
                temp = list(y) 
                list(y) = list(y + 1)
                list(y + 1) = temp
             End If
    End Function
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." Charles F. Kettering

    Read articles on My Blog 101 LINQ Samples JSON Validator XML Schema Validator "How Do I" videos on MSDN VB.NET and C# Comparison Good Coding Practices VBForums Reputation Saver String Enum Super Simple Tetris Game

    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: Bubble Sorting Words Alphabetically

    Hi Pradeep. I have a homework assignment too but I'd rather cheat also so can you write my code for me too? Persoanlly, I think it's fine for me to get full marks even though I may have put no effort into the assignment while my classmates who have tried may not. I'm glad that you feel the same.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    Addicted Member
    Join Date
    Mar 2010

    Re: Bubble Sorting Words Alphabetically

    There are also special cases for uniform alphabet usages. There are lots of solutions for this case to collect inside issue based folders to obtain the paradigm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width