[Delphi] Function sMid

Topic created · 1 Mensajes · 348 Visitas
  • En Visual Basic una función bastante utilizada para el manejo de cadenas es MID, la traigo libre de dependencias para que no usen Copy.

    function sMid(lpStr:String;nIndex:Integer;nLength:Integer):String;
    var
    i:Integer;
    begin;
    If Length(lpStr) > 0 Then
    begin
    for i := nIndex to (nLength + nIndex)-1 do
    begin
    If i = Length(lpStr) then
    begin
    Result := Result + lpStr_;
    break;
    end else
    begin
    Result := Result + lpStr_
    end;
    end;
    end;
    end__