Txt-Padder left

From Vectorlab
Jump to: navigation, search


Function to pad text with a given count of characters. Use it when you need to ensure that strings have the same length. By Orso B. Schmid


{ Orso *********************************************** }
{ pads a string with a certain number of chars at start of string }
FUNCTION T_Padder(str: STRING; paddingChar: CHAR; howMany: INTEGER): STRING;
	BEGIN
		WHILE (Len(Str) < howMany) DO
			str := Concat(paddingChar, str);
		
		T_Padder := str;
	END;