textdemoapp
Reactive icon

Text Extension Demo

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 23 October 2023
 by 
0.0
 (0 ratings)
textdemoapp

Text Extension Demo

Documentation
1.0.0

Text API


Text API provides functionality to manipulate texts using the below text method-






Structures - Text

Structure with single Text attribute

Attributes

Value (Text (50)) - Mandatory.


Format_DateTime

Formats a DateTime by replacing the allowed keywords with their values.

Available Keywords:
[yyyy] - Represents the year as a four-digit number;
[MM] - Represents the month as a number from 01 through 12;
[MMM] - Represents the abbreviated name of the month;
[MMMM] - Represents the full name of the month;
[dd] - Represents the day of the month as a number from 01 through 31;
[ddd] - Represents the abbreviated name of the day of the week;
[dddd] - Represents the full name of the day of the week;
[hh] - Represents the hour as a number from 01 through 12;
[HH] - Represents the hour as a number from 00 through 23;
[mm] - Represents the minute as a number from 0 through 59;
[ss] - Represents the seconds as a number from 00 through 59;

Inputs

  1. DateTime - The Datetime to be formated.

  2. Format Type - The Text with the available keywords used to format the Date Time.

The Text with the available keywords used to format the Date Time.

Outputs

FormattedDateTime (Text)

formatted Date Time according to the specified Format.


Example


DateTime 04-12-2008 22:55:01

Keyword - Output Result

[yyyy] - 2008
[MM] - 08
[MMM] - Dec
[MMMM] - December
[dd] - 04
[ddd] - Thru
[dddd] - Thursday
[hh] - 10;
[HH] - 22;
[mm] - 55;
[ss] - 01


Regex_Replace

Replaces all occurrences of a specified regular expression pattern with a replacement string.

Inputs

  1. Text - Text in which to search for a Pattern.

  2. Pattern - The string to modify.

  3. Replace - The replacement string.

  4. IgnoreCase - Specifies case-insensitive matching.

  5. MultiLine - Changes the meaning of ^and $ so the match at the beginning and end, respectively, of each line, and not just the beginning and end of the entire string.

  6. SingleLine  - Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).

Outputs

  1. Result - The modified character string.


Example

Text - reEet@123

Pattern - [A-Za-z]

Replace  - &

IgnoreCase - True

MultiLine - 

SingleLine - 


Output Result - &&&&&@123


Regex_Search

Searches the input string for an occurrence of a regular expression.

Inputs

  1. Text - Text in which to search for a Pattern.

  2. Pattern - Pattern to search in Text.

  3. IgnoreCase - Specifies case-insensitive matching.

  4. MultiLine - Changes the meaning of ^and $ so the match at the beginning and end, respectively, of each line, and not just the beginning and end of the entire string.

  5. SingleLine - Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).

Outputs

  1. Found - True if Pattern is found in the Text.

  2. PatternResult - Represents the matched string.

  3. FirstIndex - Index of the first occurrence of Pattern in Text.



Example

Text - reEet@123

Pattern - [A-Za-z]

IgnoreCase - True

MultiLine - 

SingleLine - 


Found - True

PatternResult 

FirstIndex 


String_Join

Concatenates all the strings in a List, yielding a single string. The individual elements are separated, in the resulting string, by the string Separator.

Inputs

  1. List - List of strings to be concatenated.

  2. Separator - Separating element.

Outputs

  1. Text - Result of concatenation.


Inputs

List - [1,2,3,4]

Separator - $


Output 






String_LastIndexOf

Reports the index position of the last occurrence of a specified Pattern within a Text.

Inputs

  1. Text - The Text to analyse.

  2. Pattern - The pattern to seek.

Outputs

  1. Position - The index position of the pattern if it was found, or -1 if it was not. If the Text is empty, the returned Position is 0.






String_Split

Splits a string into individual elements delimited by any of the characters in Delimiters.

Inputs

  1. Text - Text to be splitted into individual strings.

  2. Delimiters - Contains all the characters that should be considered as separators.

Outputs

  1. List - List of strings that results from splitting the original Text.


StringBuilder_Create

Creates a StringBuilder. Use it if you need to create a string by repeatedly appending substrings. A StringBuilder optimizes memory management when dealing with highly dynamic strings.

Inputs

  1. InitialCapacity - Initial capacity of the StringBuilder buffer. The buffer will be automatically resized if its capacity is exceeded. Set it to the maximum expected capacity to avoid buffer resizing.

Outputs

  1. StringBuilder (Object) - The StringBuilder instance. Use it as input to the other StringBuilder Actions.






StringBuilder_Append

Appends a string to a StringBuilder.

Inputs

StringBuilder - The StringBuilder instance. Returned by the Action StringBuilder_Create.

String - The string to append to the StringBuilder's buffer.






StringBuilder_ToString

Returns the content of the StringBuilder's buffer.

Inputs

  1. StringBuilder (Object) - The StringBuilder instance. Returned by the Action StringBuilder_Create.

Outputs

String (Text) - The content of the StringBuilder's buffer.




References -

https://success.outsystems.com/documentation/11/reference/outsystems_apis/text_api/