[Solved] Is string check returns false


To meet your method name, you need this:

protected bool IsStringAndNotNullAndEmpty(object value)
{
    var s = value as string;
    return s == string.Empty;
}

Changing its name to IsEmptyString(object value) would be clearer though.

It seems the OP actually wants a method that returns true for non-empty strings. So what is required is:

protected bool IsNonEmptyString(object value)
{
    var s = value as string;
    return !string.IsNullOrEmpty(s);
}

Please take care with method names to make them say what the code actually does…

0

solved Is string check returns false