Formatting functions
Formatting functions help dynamically adjust the appearance of data based on specific conditions. They help you shape text consistently, whether converting case, trimming or normalizing whitespace, truncating long strings, or making specific replacements. They simplify rule creation and ensure consistent and predictable output.
|
Function |
Description |
Input |
Output |
|---|---|---|---|
| Case Conversion | |||
|
ToTitleCase(text) |
Converts text to title case (capitalize first letter of each word). |
"hello world" |
"Hello World" |
|
ToCamelCase(text) |
Converts text to camelCase format. |
"hello world" |
"helloWorld" |
|
ToPascalCase(text) |
Converts text to PascalCase format. |
"hello world" |
"HelloWorld" |
|
Capitalize(text) |
Capitalizes the first letter of text. |
"hello world" |
"Hello world" |
| Whitespace and Trimming | |||
|
RemoveWhitespace(text) |
Removes all whitespace from text. |
"h e l l o" |
"hello" |
|
NormalizeWhitespace(text) |
Replaces multiple whitespace with single space. |
"hello world" |
"hello world" |
| Padding and Alignment | |||
|
Center(text, length, char) |
Centers text within a specified length using padding character. |
"hi", 6, ' ' |
" hi " |
| Truncation and Extraction | |||
|
Truncate(text, length) |
Truncates text to a specified length. |
"Hello World", 5 |
"Hello" |
| Replacement and Removal | |||
|
ReplaceSubString(value, oldSubstring, newSubstring) |
Replaces a substring with a new value. |
"abcabcabcacb", "ab", "2" |
"2c2c2cacb" |
|
RemoveChars(chars, value) |
Removes specified characters from text. |
"§$.-;:_()/", "$100.000,00" |
"10000000" |
|
ReplaceFirst(text, oldValue, newValue) |
Replaces only the first occurrence of a substring. |
"hello hello", "l", "L" |
"heLlo hello" |
|
ReplaceLast(text, oldValue, newValue) |
Replaces only the last occurrence of a substring. |
"hello hello", "l", "L" |
"hello helLo" |
|
Remove(text, substring) |
Removes a substring from text. |
"hello world", "l" |
"heo word" |
|
RemoveSpecialCharacters(text) |
Removes special characters from text. |
"hello@world!" |
"helloworld" |
|
RemoveDigits(text) |
Removes all digits from text. |
"abc123def" |
"abcdef" |
|
RemoveLetters(text) |
Removes all letters from text. |
"abc123def" |
"123" |
|
Replace(text, oldValue, newValue) |
Replaces occurrences of a substring. |
"hello hello", "l", "L" |
"heLLo heLLo" |
| Encoding and Escaping | |||
|
UrlDecode(text) |
Decodes URL-encoded text. |
"hello%20world" |
"hello world" |
|
HtmlEncode(text) |
Encodes text for HTML display. |
"<div>test</div>" |
"<div>test</div>" |
|
HtmlDecode(text) |
Decodes HTML-encoded text. |
"<div>" |
"<div>" |
|
Base64Encode(text) |
Encodes text to Base64 format. |
"hello" |
"aGVsbG8=" |
|
Base64Decode(text) |
Decodes Base64-encoded text. |
"aGVsbG8=" |
"hello" |
|
EscapeQuotes(text) |
Escapes quote characters in text. |
"He said \"hi\"" |
"He said \\\"hi\\\"" |
|
UnescapeQuotes(text) |
Unescapes quote characters in text. |
"He said \\\"hi\\\"" |
"He said \"hi\"" |
| Masking and Redaction | |||
|
MaskEmail(text) |
Masks an email address for privacy. |
"user@example.com" |
"u***@example.com" |
|
MaskPhone(text) |
Masks a phone number for privacy. |
"555-123-4567" |
"***-***-4567" |
|
MaskCreditCard(text) |
Masks a credit card number for privacy. |
"1234567890123456" |
"************3456" |
|
MaskSSN(text) |
Masks a social security number for privacy. |
"123-45-6789" |
"***-**-6789" |
|
Redact(text, pattern) |
Redacts text matching a pattern. |
"Secret: 12345", "\d+" |
"Secret: *****" |
| Number and Currency Formatting | |||
|
FormatCurrency(amount, code) |
Formats a number as currency with code. |
1234.56, "USD" |
"$1,234.56" |
|
FormatNumber(value, decimals) |
Formats a number with specified decimal places. |
1234567.89, 2 |
"1,234,567.89" |
|
FormatPercentage(value) |
Formats a number as a percentage. |
0.85 |
"85%" |
|
FormatPhoneNumber(value, format) |
Formats a phone number with specified format. |
"5551234567", "US" |
"(555) 123-4567" |
|
FormatSSN(value) |
Formats a social security number. |
"123456789" |
"123-45-6789" |
| Date and Time Formatting | |||
|
FormatDate(date, format) |
Formats a date with specified format. |
Date, "MM/DD/YYYY" |
"01/19/2026" |
|
FormatDateTime(datetime, format) |
Formats a date and time with specified format. |
DateTime, "YYYY-MM-DD HH:mm" |
"2026-01-19 16:20" |
|
FormatTime(time, format) |
Formats a time with specified format. |
Time, "HH:mm:ss" |
"16:20:30" |
|
ToRelativeTime(date) |
Converts a date to relative time. |
Date (2 days ago) |
"2 days ago" |
| Validation Formatting | |||
|
NormalizeEmail(text) |
Normalizes an email address format. |
"User@EXAMPLE.COM" |
"user@example.com" |
|
NormalizePhoneNumber(text) |
Normalizes a phone number format. |
"(555) 123-4567" |
"5551234567" |
|
StripHtml(text) |
Removes HTML tags from text. |
"<p>Hello</p>" |
"Hello" |
|
SanitizeFilename(text) |
Sanitizes text for use as a filename. |
"file:name?.txt" |
"filename.txt" |
| Data Type Conversion | |||
|
ToInt(value) |
Converts a value to integer. |
"123" or 123.45 or true |
123 or 123 or 1 |
|
ToDouble(value) |
Converts a value to double. |
"123.45" or 123 or "45%" |
123.45 or 123.0 or 0.45 |
|
ToFloat(value) |
Converts a value to float. |
"123.45" or 123 or "45%" |
123.45f or 123.0f or 0.45f |
|
ToBoolean(value) |
Converts a value to Boolean. |
"true" or 1 or "yes" |
true or true or true |
|
ToChar(value) |
Converts a value to character. |
"A" or 65 |
'A' or 'A' |
|
ToDecimal(value) |
Converts a value to decimal. |
"123.456789" or 123.456789 |
123.456789m |
|
ToLong(value) |
Converts a value to long integer. |
"9223372036854775807" or 123 |
9223372036854775807L |
|
ToShort(value) |
Converts a value to short integer. |
"32767" or 100 |
32767 or 100 |
|
ToByte(value) |
Converts a value to byte. |
"255" or 100 |
255 or 100 |