c++ cli - Error on !String.IsNullOrEmpty(s)) -
this code in c++
list<string^> ^getcodecs() { list<string^> ^l = gcnew list<string^>; string ^s = gcnew string(encoder_getfirstcodecname()); while (!string.isnullorempty(s)) { l->add(s); s = gcnew string(encoder_getnextcodecname()); } return l; }
the error on line:
while (!string.isnullorempty(s))
on string
the error/s string:
this warning:
warning 1 warning c4832: token '.' illegal after udt 'system::string'
the errors:
error 2 error c2275: 'system::string' : illegal use of type expression error 3 error c2228: left of '.isnullorempty' must have class/struct/union error 4 error c1903: unable recover previous error(s); stopping compilation error 5 intellisense: type name not allowed
how can fix them ?
since isnullorempty
static function, you'd have call using ::
operator:
while (!string::isnullorempty(s))
Comments
Post a Comment