Ver Mensaje Individual
  #2  
Antiguo 02-03-2008
Avatar de ixMike
ixMike ixMike is offline
Miembro
 
Registrado: feb 2004
Posts: 1.151
Reputación: 24
ixMike Va por buen camino
Hola. Bienvenido, y bien por leerte la guía

Puedes utilizar la función Copy.

Cita:
Empezado por Ayuda de Delphi
The Copy function returns a substring of a string.

S is a string-type expression. Index and Count are integer-type expressions. Copy returns a string containing Count characters starting at S[Index].

If Index is larger than the length of S, Copy returns an empty string.

If Count specifies more characters than are available, the only the characters from S[Index] to the end of S are returned.

Combinada con la función Length. Algo así:

Código Delphi [-]
function Izquierda(const S: String; Count: Integer): String;
begin
Result:=Copy(S, 1, Count);
end;

function Derecha(const S: String; Count: Integer): String;
begin
Result:=Copy(S, Length(S)-Count, Count);
end;


Nota: la función "Izquierda" la puedes sustituir por la misma función Copy.


Salu2
Responder Con Cita