home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
files
/
bbs
/
pibterm
/
pibt3sp1
/
ltrim.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-08-30
|
2KB
|
60 lines
(*--------------------------------------------------------------------------*)
(* LTrim --- LTrim leading blanks from a string *)
(*--------------------------------------------------------------------------*)
FUNCTION LTrim( S : AnyStr ) : AnyStr;
(*--------------------------------------------------------------------------*)
(* *)
(* Function: LTrim *)
(* *)
(* Purpose: Trims leading blanks from a string *)
(* *)
(* Calling sequence: *)
(* *)
(* LTrimmed_S := TRIM( S ); *)
(* *)
(* S --- the string to be trimmed *)
(* LTrimmed_S --- the trimmed version of S *)
(* *)
(* Calls: None *)
(* *)
(* Remarks: *)
(* *)
(* Note that the original string itself is left untrimmed. *)
(* *)
(*--------------------------------------------------------------------------*)
VAR
I: INTEGER;
Trimmed: BOOLEAN;
L: INTEGER;
BEGIN (* LTrim *)
LTrim := '';
IF LENGTH( S ) > 0 THEN
BEGIN
I := 0;
L := LENGTH( S );
Trimmed := FALSE;
REPEAT
I := I + 1;
IF ( I <= L ) THEN
Trimmed := S[I] <> ' '
ELSE
Trimmed := TRUE;
UNTIL Trimmed;
IF ( ( L - I + 1 ) > 0 ) THEN
LTrim := COPY( S, I, L - I + 1 );
END;
END (* LTrim *);
ə