15-09-2014, 10:13 AM
السلام عليكم
طريقة اخرى اخر كلمتين اتركها لك :confused:
طريقة اخرى اخر كلمتين اتركها لك :confused:
PHP كود :
function TForm1.LastWord(Value: String): String;
begin
// get the last line
Value := Copy(Value, LastDelimiter(#13#10, Value), Length(Value));
// get the last word
Result := Trim(copy(Value, LastDelimiter(' ',Value), Length(Value)));
end;
procedure TForm1.Memo1Change(Sender: TObject);
begin
if not (LastWord(Memo1.Text) = EmptyStr) then
Caption := LastWord(Memo1.Text);
end;
و لرب نازلة يضيق لها الفتى ذرعا و عند الله منها المخرج
ضاقت فلما استحكمت حلقاتها فرجت و كنت اضنها لا تفرج
ضاقت فلما استحكمت حلقاتها فرجت و كنت اضنها لا تفرج

