Documentation
Back to website >

Capitalize (Pascalscript)

Description

Converts the first letter of a word to uppercase. Only standard ASCII characters are taken into account for conversion.

Syntax

function Capitalize(const S: String): String;

Arguments

The input parameter S contains the text to be converted.

Example

var
  Salt: String;
  Sneu: String;
begin
  Salt:='this is a text without capital letters';
  New:=Capitalize(Salt);
  ShowMessage(Sneu);
end;

Rules to understand the script can be found here.

The text 'this is a text without capital letters' is assigned to the variable Salt. The Capialize function converts the text from Salt so that each letter at the beginning of the word is converted to an uppercase letter. This converted text is assigned to the variable Sneu. This is output in ShowMessage.

ShowMessage shows: This Is A Text Without Capital Letters