I have a String variable columnNames which includes the column names of a grid I am trying to sort.
String columnNames = "To, From, RHVAC Technician Schedules Complete, MST Schedules Complete". 
I am looking to split this into a String Array with 4 values. I have tried the following line of code :
String[] headersAllJobs = columnNames.split(" ");
However, when I run this, the commas are still stuck to the value so I have for example "To," and "From,". How can I split these values without the commas?
 
     
     
    