From Clomosy Docs

(Created page with " function Length(const SourceString string):Integer; The length function returns the element count of the number of characters in the SourceString. It is often used to loop around all the characters in a string. '''Example:'''<br> '''var''' valueStr : string;<br> '''begin'''<br> valueStr := 'Clomosy'; ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr)));<br> '''end;''' '''Output:'''<br> Length of valueStr = 7")
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
function Length(const SourceString string):Integer;
<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 SourceString. It is often used to loop around all the characters in a string.
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:'''<br>
<b>Example</b><br>
'''var'''
  valueStr    : string;<br>
'''begin'''<br>
  valueStr := 'Clomosy';
  ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr)));<br>
'''end;'''


'''Output:'''<br>
<pre>
Length of valueStr = 7
var
valueStr    : string;
{
 
valueStr = 'Clomosy';
ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr)));
 
}
</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]]
{{#seo:|title=Length Using in Clomosy - Clomosy Docs}}
{{#seo:|description=Use the Length function in Clomosy to get the number of characters in a string.}}

Latest revision as of 14:21, 24 December 2024

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

var
 valueStr    : string;
{

 valueStr = 'Clomosy';
 ShowMessage('Length of valueStr = '+IntToStr(Length(valueStr)));

}

Output:

See Also