From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
function Length(S: String): Integer; | |||
</div> | |||
The length function returns the element count of the number of characters in the | The length function returns the element count of the number of characters in the S. It is often used to loop around all the characters in a string. | ||
<b>Example</b><br> | |||
<b>TRObject Syntax</b><br> | |||
<pre> | |||
var | |||
valueStr : string; | |||
{ | |||
valueStr = 'Clomosy'; | |||
ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr))); | |||
'''Output: | } | ||
</pre> | |||
<b>Base Syntax</b><br> | |||
<pre> | |||
var | |||
valueStr : string; | |||
begin | |||
valueStr := 'Clomosy'; | |||
ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr))); | |||
end; | |||
</pre> | |||
<b>Output:</b><br> | |||
<div class="alert alert-success" role="alert" data-bs-theme="light"> | |||
Length of valueStr = 7 | |||
</div> | |||
<h2> See Also </h2> | |||
* [[System_Library#String_Functions | String Functions]] | |||
Revision as of 07:53, 7 October 2024
function Length(S: String): Integer;
The length function returns the element count of the number of characters in the S. It is often used to loop around all the characters in a string.
Example
TRObject Syntax
var
valueStr : string;
{
valueStr = 'Clomosy';
ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr)));
}
Base Syntax
var
valueStr : string;
begin
valueStr := 'Clomosy';
ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr)));
end;
Output:
Length of valueStr = 7