OutSystems Platform Text API provides functionality to manipulate texts as, for example: search and replace using a regular expression, split,  join, or format DateTimes.

Summary

Actions

Actions
Format_DateTime Formats the DateTime value into text.
Regex_Replace Replaces all occurrences matching the regular expression with the given text.
Regex_Search Searches for an occurrence of the regular expression in the text.
String_Join Concatenates all texts in the list into a single text, with a separator between them.
String_LastIndexOf Returns the index of the last occurrence of a specified pattern.
String_Split Splits a text on every occurrence of some characters.
StringBuilder_Append

Appends a text to a StringBuilder object.

StringBuilder_Create

Creates a StringBuilder object. It optimizes performance when dealing with a text that repeatedly needs to have texts appended to it.

StringBuilder_ToString Converts the content of a StringBuilder object to text.
 

Structures

Structures
Text The structure used in lists of texts.

Actions

Format_DateTime

Formats the DateTime value into text.

Inputs


DateTime

Type: DateTime. Mandatory.
The DateTime to be formatted.

Format

Type: Text. Mandatory.

The specification of the DataTime format using:
 
Year
[yyyy] - The year in a four-digit number.

Month
[MM] - The month from 01 through 12.
[MMM] - The abbreviated name of the month.
[MMMM] - The full name of the month.


Day
[dd] - The day of the month from 01 through 31.
[ddd] - The abbreviated name of the day of the week. 
[dddd] - The full name of the day of the week.


Hour
[hh] - The hour from 01 through 12.
[HH] - The hour from 00 through 23.
 

Minute
[mm] - The minute from 0 through 59. 
 
Second
[ss] - The seconds from 00 through 59.

Outputs


FormattedDateTime

Type: Text.
The formatted DateTime.

Regex_Replace

Replaces all occurrences matching the regular expression with the given text.

Inputs


Text

Type: Text. Mandatory.
Text in which to search for the regular expression.

Pattern

Type: Text. Mandatory.
The regular expression to search.

Replace

Type: Text. Mandatory.
The text to replace in each occurrence found. 

IgnoreCase

Type: Boolean.
Default: True
If True, the matching is not case-sensitive.

MultiLine

Type: Boolean.
Default: False
If True the '^' and '$' wildcards match the beginning and end of each line. Otherwise, they are the beginning and end of the entire text.

SingleLine

Type: Boolean.
Default: False
If True, the dot ('.') wildcard matches any character. Otherwise, it is any character but '\n'.

Outputs


Result

Type: Text.
The text with the replacements.

Regex_Search

Searches for an occurrence of the regular expression in the text.

Inputs


Text

Type: Text. Mandatory.
Text to search for the regular expression.

Pattern

Type: Text. Mandatory.
The regular expression to search.

IgnoreCase

Type: Boolean.
Default: True
If True, the matching is not case-sensitive.

MultiLine

Type: Boolean.
Default: False
If True the '^' and '$' wildcards are the beginning and end of each line. Otherwise, they are the beginning and end of the entire text.

SingleLine

Type: Boolean.
Default: False
If True, the dot ('.') wildcard is any character. Otherwise, it is any character but '\n'.

Outputs


Found

Type: Boolean.
It's True if there is a match with the regular expression.

PatternResult

Type: Text.
The text matching the regular expression. 

FirstIndex

Type: Integer.
Index of the first match of the regular expression in the text.

String_Join

Concatenates all texts in the list into a single text, with a separator between them.

Inputs


List
Type: RecordList of  Text. Mandatory.
List of texts to be concatenated.

Separator

Type: Text. Mandatory.
The separator to put between concatenated texts.

Outputs


Text

Type: Text.
The result of the concatenation.

String_LastIndexOf

Returns the index of the last occurrence of a specified regular expression.

Inputs


Text

Type: Text.
Text to search for the regular expression.

Pattern

Type: Text. Mandatory.
The regular expression to search.

Outputs


Position

Type: Integer.
The index where the last match with the regular expression was found. It is -1 if it was not found. It is 0 If the text is empty.

String_Split

Splits a text on every occurrence of some characters. These characters are considered just for splitting and won’t be part of the result.

Inputs


Text

Type: Text. Mandatory.
The text to be split.

Delimiters

Type: Text. Mandatory.
The character(s) where the text is split.

Outputs


List

Type: RecordList of  Text.
List of texts resulting from the split.

StringBuilder_Append

Appends a text to a StringBuilder object.

Inputs


StringBuilder

Type: Object. Mandatory.
The StringBuilder object, created by the StringBuilder_Create action.

String

Type: Text. Mandatory.
The text to append to the StringBuilder.

StringBuilder_Create

Creates a StringBuilder object. It optimizes performance when dealing with a text that repeatedly needs to have texts appended to it.

Inputs


InitialCapacity

Type: Integer. Mandatory.
Initial size of a StringBuilder object. Set it to a maximum expected capacity to avoid re-sizing every time the size is exceeded.

Outputs


StringBuilder

Type: Object.
The StringBuilder object.

StringBuilder_ToString

Converts the content of a StringBuilder object to text.

Inputs


StringBuilder

Type: Object. Mandatory.
The StringBuilder object.

Outputs


String

Type: Text.
The StringBuilder object converted to text.

Structures

Text

The structure used in lists of texts.

Attributes

Value

Type: Text (50). Mandatory.
The text value.