Lab 30: Sort Without Articles

Link to Lab 30:

This lab, if the title didn't give it away is creating a list that would sort alphabetically, but at the same time ignoring the articles such as "the" and "a". The two main parts of the code needed to make this lab possible are actually the code that basically eliminates the articles of, in this case, the artist's name and the code needed to actually create a sorted list. The code used to eliminate the articles is simply a function with one line of code that replaces specified articles such as "the" with " ", which is just empty space. The code to sort the artists is simply an if else statement that compares the first letter and sees which one is greater and returns a 1 or -1. Although this lab may not seem very interesting, I still believe this is a neat trick to know just in case one needs to eliminate articles when creating a list


Comments

Popular posts from this blog

Lab 23-2: Type Ahead

WBL Workshop 2

Lab7 - Simple Accordion