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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -