I have an ArrayList and a string which I want to find chars of ArrayList in it. My ArrayList is named punctuations.
It fails to cast and says at least one source element can't be cast to dest array type.Code:tatic System::Collections::ArrayList ^punctuations = gcnew System::Collections::ArrayList; punctuations->Add('/'); punctuations->Add('\n'); punctuations->Add(' '); punctuations->Add('\t'); punctuations->Add('\"'); punctuations->Add('\''); array<wchar_t>^myArr =safe_cast<array<wchar_t>^>(punctuations->ToArray(wchar_t::typeid)); int firstToken = text->IndexOfAny(myArr, startpos);
But don't know why...



LinkBack URL
About LinkBacks



