S
sparkydarky
I have a bunch of strings in a database that have in them a number I
want to extract. Here's the example code I've been working with:
AnsiString tmp = "AMjsdfdsdfj 457756 some description";
int firstDelim = 0;
int secondDelim = 0;
for(int i=0; i<=tmp.Length(); i++)
{
if(IsDelimiter(" ", tmp, i));
{
if ( firstDelim == 0 )
firstDelim = i;
else
{
secondDelim = i;
break;
}
}
if ( secondDelim > 0 )
break;
}
int str_length = secondDelim - firstDelim;
ShowMessage(tmp.SubString(firstDelim, str_length));
Can someone give me a hint how to get this to work? Is my code way
off, or is there a better way to do it? it's only about 1500 records
I need to do this on, so speed is not of greatest importance.
Mark
want to extract. Here's the example code I've been working with:
AnsiString tmp = "AMjsdfdsdfj 457756 some description";
int firstDelim = 0;
int secondDelim = 0;
for(int i=0; i<=tmp.Length(); i++)
{
if(IsDelimiter(" ", tmp, i));
{
if ( firstDelim == 0 )
firstDelim = i;
else
{
secondDelim = i;
break;
}
}
if ( secondDelim > 0 )
break;
}
int str_length = secondDelim - firstDelim;
ShowMessage(tmp.SubString(firstDelim, str_length));
Can someone give me a hint how to get this to work? Is my code way
off, or is there a better way to do it? it's only about 1500 records
I need to do this on, so speed is not of greatest importance.
Mark