Quote:
error code of CS0162 "unreachable code detected"
This error message do not tell you that there is an error where you see it, it tells you that preceding code is made in such a way that the line of "unreachable code" will never be executed.
At compile time, the compiler can detect that
sub
will never be empty and thus will always "return true" and following code will never be executed.
This can be done on purpose, for testing, thus the warning. Your pragma transform the warning to an error.
So you can do any change on string, it will never solve the problem because it is not the problem.