Ver Mensaje Individual
  #18  
Antiguo 13-11-2012
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
Club Delphi,

Para contribuir a la idea de ecfisa:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure Split(const Delimiter: Char; Input: string; const Strings: TStrings);
begin
   Strings.Clear;
   Strings.Delimiter := Delimiter;
   Strings.DelimitedText := Input;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
   StrList: TStringList;
   i : Integer;
   s : String;
begin
   StrList := TStringList.Create;
   try
      Split(' ', 'Hola Test Mundo', StrList) ;
      for i := 0 to StrList.Count - 1 do
         ShowMessage(StrList[i]);
      for i:= 0 to StrList.Count - 1 do
         if StrList[i] <> 'Test' then
           s := s + ' ' + StrList[i];
      ShowMessage(s);
   finally
      StrList.Free;
   end;
end;

end.
Espero sea útil

Nelson.

Última edición por nlsgarcia fecha: 13-11-2012 a las 20:18:28.
Responder Con Cita