C#: splitting a string and not returning empty string

String.Split takes an array when including any StringSplitOptions:

string[] batchstring = batch_idTextBox.Text.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries);

If you don’t need options, the syntax becomes easier:

string[] batchstring = batch_idTextBox.Text.Split(';');

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)