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 clGetStringTo(mainText,ConditionText:String):String;
</div>
In Clomosy, you can use the clGetStringTo function to retrieve text that precedes a character or characters in the text. The basic usage of the clGetStringTo function is as follows:
In Clomosy, you can use the clGetStringTo function to retrieve text that precedes a character or characters in the text. The basic usage of the clGetStringTo function is as follows:


  clGetStringTo(mainText, ConditionText'): String
<b>Example</b><br>
 
<b>TRObject Syntax</b><br>
'''Example:'''
<pre>
var
  mainText,ConditionText,updatedText : String;


  ShowMessage(clGetStringTo('AAbBCC','CC'));
{
mainText = 'AAbBCC';
ConditionText = 'CC';
updatedText = clGetStringTo(mainText,ConditionText);
ShowMessage('Updated Text: '+ updatedText);
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
mainText,ConditionText,updatedText : String;


begin
mainText := 'AAbBCC';
ConditionText := 'CC';
updatedText := clGetStringTo(mainText,ConditionText);
ShowMessage('Updated Text: '+ updatedText);
end;
</pre>


'''Output:'''
<b>Output:</b><br>
AAbB
<div class="alert alert-success" role="alert" data-bs-theme="light">
Updated Text: AAbB
</div>


= See Also =
<h2> See Also </h2>
* [[Controls| Controls]]
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]

Revision as of 06:46, 10 October 2024

In Clomosy, you can use the clGetStringTo function to retrieve text that precedes a character or characters in the text. The basic usage of the clGetStringTo function is as follows:

Example
TRObject Syntax

var
 mainText,ConditionText,updatedText : String;

{
 mainText = 'AAbBCC';
 ConditionText = 'CC';
 updatedText = clGetStringTo(mainText,ConditionText);
 ShowMessage('Updated Text: '+ updatedText);
}

Base Syntax

var
 mainText,ConditionText,updatedText : String;

begin
 mainText := 'AAbBCC';
 ConditionText := 'CC';
 updatedText := clGetStringTo(mainText,ConditionText);
 ShowMessage('Updated Text: '+ updatedText);
end;

Output:

See Also