I have a problem, I am trying to convert from C# to C++/CLI and I don't know how to return a string array in a method. The problem is that strings are showing up as numbers instead of strings.
Here is the Method:
static array<String^> ^Split(String^ Victim, char SplitPoint)
{
int Index=0;
for each(char Char in Victim)
if(Char==SplitPoint)
Index++;
array<String^> ^SplitStrings = gcnew array<String^>;
Index=0;
for each(char Char in Victim)
{
if(Char==SplitPoint)
Index++;
else
SplitStrings[Index]=SplitStrings[Index]+Char;
}
return SplitStrings;
};
and the original method in C# looks like this:
public static string[] Split(string Victim, char SplitPoint)
{
int Index = 0;
foreach (char Char in Victim)
if (Char == SplitPoint)
Index++;
string[] SplitStrings = new string[Index + 1];
Index = 0;
foreach (char Char in Victim)
{
if (Char == SplitPoint)
{
Index++;
}
else
SplitStrings[Index] = SplitStrings[Index] + Char;
}
return SplitStrings;
}
System::String::Splitfor this?