Jump to content
Developer Wiki and Function Reference Links ×

Upper Case String to Title Caps


Recommended Posts

Hi Julian,

   Here's one for lower case.

PROCEDURE TEST;
CONST
	CR = chr(13);
VAR
	S :String;

	function LowerCase(S :String) :String;
	{ Convert string S to lower case. }
	Var
		Ch :Char;
		I, StrLen, ChVal :Integer;
		T :String;
	Begin
		T := '';
		StrLen := len(S);
		for I := 1 to StrLen do begin
			Ch := copy(S, I, 1);
			ChVal := ord(Ch);
			if (ChVal > 64) & (ChVal < 91) then
				T := concat(T, chr(ChVal+32))
			else T := concat(T, Ch);
		end;		{ for }
		LowerCase := T;
	End;		{ LowerCase }


BEGIN
	S := '0123456789 !@#$%^&*()_+ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz';
	message(S, CR, LowerCase(S));
END;
Run(TEST);

 

Raymond

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...