So my goal is that I want a pick list that when I select values from it, it adds the newly selected value comma separated from the previous values - essentially allowing the user to select multiple options from the pick list.

I googled and I have working code which does just this, the only problem is that nothing stops the user from selecting the same item over and over, and the items end up out of order. I want to split the string into an array of strings using Split(), and sorting it alphabetically, and if the newly chosen item already exists, then it isn't appended onto the list.

The problem I am having is that I can't figure out how to import the libraries / namespaces that the functions Split(), IndexOf(), Array.Sort(), etc. are involved in.

Here is a link to the code I have so far - the IndexOf line isn't recognized, and "Imports System" at the top results in an "Invalid Outside Procedure" error.

http://pastebin.com/raw.php?i=yBw4NKXw

Any help or guidance would be really appreciated - thanks!