AnsiString strText = Memo1->Text;//copy the memo text to a new buffer
//replace the ENTER to the SPACE
strText = StringReplace(strText, "\r\n", " ", TReplaceFlags() << rfReplaceAll);
//replace the TAB to the SPACE
strText = StringReplace(strText, "\t", " ", TReplaceFlags() << rfReplaceAll);
//delete head and tail SPACE
strText = strText.Trim();
TStringList *pList = new TStringList();
while (!strText.IsEmpty())
{
int nPos = strText.Pos(" ");
AnsiString strTemp = strText.SubString(1, nPos);
pList->Add(strTemp.Trim());
strText = strText(nPos+1, strText.Length()).Trim();
}