Is it possible to use a regular expression to detect anything that is NOT an \"empty string\" like this:
string s1 = \"\";
string s2 = \" \";
string s3 = \"
You can do one of two things:
^\s*$; a match means the string is "empty"
^, $ are the beginning and end of string anchors respectively\s is a whitespace character* is zero-or-more repetition of\S; an occurrence means the string is NOT "empty"
\S is the negated version of \s (note the case difference)\S therefore matches any non-whitespace characterRegexOptions.ECMAScript, \s matches things like ellipsis …