C# Checking if split method is empty :     using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace switchStatementExercise
    {
        class Program
        {
            static void Main(string[] args)
            {
                String response;
    
                Console.WriteLine("Please Vote for your president out of the 7 following, Joseph Mason, James Long, Ben Harding, Georgia Mason, Keith Webb, Mark Grimley, Max Gridley");
                response = Console.ReadLine();
    
                string fullNameJoe = response;
                var names = fullNameJoe.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries);
                string firstName = names[0];
                string lastName = names[1];
                Console.WriteLine(lastName);
                if (response.Equals(fullNameJoe) || response.Equals(firstName) || response.Equals(lastName))
                {
                    Console.WriteLine("You have voted for " + fullNameJoe);
                    Console.WriteLine(fullNameJoe);
    
                }
                else if (fullNameJoe.Length > 1 && lastName == null)
                {
    
                    Console.WriteLine("You need a last name");
                }
                else
                {
                    Console.WriteLine("Please enter a first name and last name");
                }
    
            }
        }
    }
              
    So what i'm trying to do is check if the last name is empty it was all the user to enter a last name, but I am getting this error.

Please Vote for your president out of the 7 following, Joseph Mason, James Long, Ben Harding, Georgia Mason, Keith Webb, Mark Grimley, Max Gridley
Joe

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at switchStatementExercise.Program.Main(String[] args) in C:\Users\Joe\Desktop\cSharpWeek1\switchStatementExercise\switchStatementExercise\Program.cs:line 21

Any help or redirection to the answer would be great! 
             
           
    
    
         

