Txt-Padder right

From Vectorlab
Jump to: navigation, search


Function to add as many characters to the end of a string as needed for it to have a certain length. Use it when you need to ensure that strings have the same length. See also T_Padder. By Orso B. Schmid


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