// dividir a string de acordo com a string, que é equivalente à função dividida em VB
função splitstring (const fonte, ch: string): tstringList;
var
temp: string;
I: Inteiro;
Começar
Resultado: = tStringList.create;
// Se for uma string vazia, retorne a uma lista vazia
Se fonte = ''
então saia;
temp: = fonte;
i: = pos (ch, fonte);
enquanto eu <> 0 faço
Começar
Resultado.add (cópia (temp, 0, i-1));
Excluir (temp, 1, i);
i: = pos (ch, temp);
fim;
Resultado.add (temp);
fim;
www.sinoprise.com