I have an array of names concatenated with an _
ex: string[] samples = ["Test_test","Test2_blah", "Test3_"]
.
At some point in my code I want to try and validate the value after the _
to check if it's empty or null, and if it is, remove it from the array like so :
string[] splitSample= samples[2].Split(new char[] { '_' }, 2);
if(!string.IsNullOrWhiteSpace(splitSample[1]))
The problem i'm running into is that splitSample[1]
is ""
, when i check the length of the string it's 1, not 0 but in Visual Studio 2017 it shows empty quotes. Is there a way to actually see the value that's invisible or what's actually going on?
EDIT:
Here's a pic of the immediate window when i check the array value