StringSplit with two-dimensional array

 

Hello,

does somebody know, if is there a possibility to use a two-dimensional array in the StringSplit function. If I use it like bellow, than I get always an error: ']' - expression expected, 'TradeValues' - array required

I want to write the split strings in the second dimension of the array TradeValues[][]


string sep=";";                // A separator as a character
ushort u_sep;                  // The code of the separator character
u_sep=StringGetCharacter(sep,0);

string  LineValues[100];   
string TradeValues[100][8];
   
for(int k=0;k<100;k++){
   StringSplit(LineValues[k],u_sep,TradeValues[100][]);      
}

or

string sep=";";                // A separator as a character
ushort u_sep;                  // The code of the separator character
u_sep=StringGetCharacter(sep,0);

string  LineValues[100];
string TradeValues[100][8];   
for(int k=0;k<100;k++){
      StringSplit(LineValues[k],u_sep,TradeValues[100]);      
}

Thank you very much!


 

No you can't if you would have looked into your reference under StringSplit you would have seen the definition:

int  StringSplit(
   const string   string_value,       // A string to search in
   const ushort   separator,          // A separator using which substrings will be searched
   string         & result[]          // An array passed by reference to get the found substrings
   );

and StringSplit(..) expects only a one dimensional string array result[].

Then you can copy element by element..