O que substitui a funçao SubString do C ?
[b:c687e364e0][color=green:c687e364e0]Essa linha em C, o q ela faz?[/color:c687e364e0]
[/b:c687e364e0]
Achei isso a respeito do
[b:c687e364e0]SubString:[/b:c687e364e0]
Retrieves a substring from this instance.
The substring starts at a specified character position and has a specified length.
public: String* Substring(
int startIndex,
int length
);
Em Delphi
eu sei que ta errado, eu queria saber [b:c687e364e0]Como que eu faço?
[/b:c687e364e0]
[/b:c687e364e0]
int* TTabela::OrdenaHoras(TStringList *strings, TOrdenacao tipoOrdem)
{
TColunas *aux;
TColunas **colunas = new TColunas*[strings->Count];
TDateTime dt1, dt2;
int hora, min;
Hora = colunas[i]->getString().SubString(1,colunas[i]->getString().Pos(":")-1).ToInt();
Achei isso a respeito do
[b:c687e364e0]SubString:[/b:c687e364e0]
Retrieves a substring from this instance.
The substring starts at a specified character position and has a specified length.
public: String* Substring(
int startIndex,
int length
);
Em Delphi
function OrdenaHoras(strings:TStringList; tipoOrdem:TOrdenacao):Integer; var aux : TColunas; colunas : array of TColunas; dt1, dt2 : TDateTime; i, j : Integer; Hora:= StrToInt(colunas[i].getString().SubString(1,Pos(colunas[i].getString(),´:´)-1));
eu sei que ta errado, eu queria saber [b:c687e364e0]Como que eu faço?
[/b:c687e364e0]
Michelli88
Curtidas 0
Respostas
Rjun
01/07/2005
Substring retorna um pedaço de uma string da posição 1 a posição 2. Igual a função copy do delphi.
Hora := StrToInt(Copy(colunas[i], 1, Pos(Colunas[i], ´:´) - 1));
GOSTEI 0
Michelli88
01/07/2005
Valeu colega, deu certinho!
:wink:
:wink:
GOSTEI 0