I get no errors, and no warnings when compiling what I posted, and upon further inspection I realise why. The first entry you get for intellisense is Split(... cli::array<__wchar_t,1> ^seperator) so it's just converting my 3 into a wchar_t. Now I feel stupid... Thanks for your help.
jmlsteele
Posts
-
String.Split not functioning correctly? -
String.Split not functioning correctly?---CODE--- // Split Test: String::Split does NOT work properly when given a # of substrings to return void splitTest() { String^ toBeSplit = "a b c d e f g h"; array^ split = toBeSplit->Split(' ',3); //Expected: "Count: 3" Actual "Count: 8" Console::WriteLine("Count: {0}",split->Length); } ---END CODE--- Am I doing something ridiculously stupid, or is this really a bug? The equivilent C# code works properly.
-
Undocumented problem with for eachCode is self explanitory. Adding braces around the for each block fixes it, but this shouldn't be required. Unless of course you can point me to something that says this is expected behaviour. Jody Steele -----CODE START----- using namespace System; using namespace System::Collections; int main(array ^args) { //Define a test array ArrayList test; //Populate it with some data test.Add(3); test.Add(4); test.Add(13); test.Add(42); //Works as expected: WriteLine not called if (false) Console::WriteLine("Test"); //Works as expected: for not entered if (false) for(int i=0;i