String Functions
December 16, 2025 ยท View on GitHub
"STRING CONVERSION"
Matrix of Formats
-
Html to Text
-
XML to JSON
-
JSON to CSV
-
CSV to Markdown
-
Markdown to XML
-
Text to Html
-
Text - XML - JSON - CSV - Markdown
-
Html - Rasterized.
-
"Higher Level" formats (less consistent)
-
PDF
-
Word
-
Excel
-
Index
-
Tuple
-
SQL Table Row
-
Python
-
PREDICATES --
-
FORMATTERS --
-
AGGREGATES --
-
CONVERSIONS
-
encoders
-
decoders
Casing
-
CamelCase- Converts a string to camelCase -
CobolCase- Converts a string to COBOL-CASE -
KebabCase- Converts a string to kebab-case -
LowerToLower-LowerCase(x)LCase(x)
-
PascalCase- Converts a string to PascalCase -
ProperCase- Converts a string to Proper Case -
ScreamingSnakeCase- Converts a string to SCREAMING_SNAKE_CASE -
SentenceCase- Converts a string to "Sentence case." --via-minima. -
SeparateByCase- Inserts spaces in Pascal-cased or camel-cased strings -
SnakeCase- Converts a string to snake_case -
SingleSpaceWords- Trims a string and replaces multiple spaces with single spaces -
SpongeBobSnakeCase- Converts a string to sPoNgEbOb_sNaKeCaSe -
TitleCase(x) -
TitleCase- Converts a string to Title Case -
TrainCase- Converts a string to Train-Case -
UPPERConverts a string to upper-case -
Uppercase(x) Converts a string to upper case -
capitalize() Converts the first character to upper case -
casefold() Converts string into lower case
Spacing and Alignment
-
center() Returns a centered string -
expandtabs() Sets the tab size of the string -
SingleSpaceWords- Trims a string and replaces multiple spaces with single spaces- see also:
SeparateByCase- Inserts spaces in Pascal-cased or camel-cased strings
- see also:
-
CanonicalizeString() - Commonly based on -- slugify- see also:
CanonicalizeDateTime
- see also:
Predicates
-
Contains(String, Target, CaseInsensitive=1) -
endswith() Returns true if the string ends with the specified value -
EndsWith(String, Target, CaseInsensitive=1) -
StartsWith(String, Target, CaseInsensitive=1)
Search and Measure
find() Searches the string for a specified value and returns the position of where it was foundcount() Returns the number of times a specified value occurs in a stringglyphwidth()MeasureText() -- Determines the expected display width in, characters, of a sequence of utf8 bytes.substring()- previously:
mid()
- previously:
- left()
- right()
- "throw / catch" (previously "onError goto")
Strippers
-
Sluggifyis like this -- it's a mapping to a smaller map, a reduction. -
AlphabeticOnly- Removes any non-alphabetic characters from a string -
AlphanumericOnly- Removes any non-alphanumeric characters from a string -
AsciiOnly- Removes non-ASCII characters from a string -
DigitsOnly- Removes non-digit characters from a string -
Filter- Filters a string based on a filter. -
Strip- remove all blah. -
Trim(TrimEnd) (TrimStart) - trims sets of chars, or strings, or regexen.
Lookups
ASCIIReturns the ASCII value for the specific characterCHARReturns the character based on the ASCII codeCHARINDEXReturns the position of a substring in a stringConcat with +Adds two or more strings togetherCONCAT_WSAdds two or more strings together with a separatorCONCATAdds two or more strings togetherCountWords(String)CountWords- Counts the number of words in a stringDATALENGTHReturns the number of bytes used to represent an expressionDecomposeUnicodeForMatch(String)DIFFERENCECompares two SOUNDEX values, and returns an integer valueExtractToken- Extracts a specific token number from a delimited string like a CSV or TSVExtractTrigrams- Extracts trigrams (segments of up to 3 characters) from a string for fast searchingExtractTrimmedWords- Extracts words from a string and trims themFindString(String,Target)FORMATFormats a value with the specified formatGetWord(String, n)InitialsFromName- Extracts a person's initials from their nameInvertString- Returns an upside down version of the stringLeft(x, len)LEFTExtracts a number of characters from a string (starting from left)LeftPad- Left pads a stringLENReturns the length of a stringLength(x)LOWERConverts a string to lower-caseLowerCase(x)LTRIMRemoves leading spaces from a stringMD5_ASCII(String)MD5_UNICODE(String)NCHARReturns the Unicode character based on the number codeNullIfBlank- Returns NULL if a string is blank or trims the stringPadLeft (str, len, char)PadRight (str, len, char)PATINDEXReturns the position of a pattern in a stringPercentEncode- Encodes reserved characters that are used in HTML or URL encodingPreviousNonWhitespaceCharacter- Finds the previous non-whitespace character working backwards from the current positionQUOTENAMEReturns a Unicode string with delimiters added to make the string a valid SQL Server delimited identifierQuoteString- Quotes a stringREGEX_CountMatches(string,pattern,icase)REGEX_Match(string,pattern,icase)REGEX_Replace(string, pattern, replace,icase)Replace(Str, Target, Replacement)REPLACEReplaces all occurrences of a substring within a string, with a new substringReplaceChar(x, y, z)ReplaceFirst(Str, Target, Replacement)REPLICATERepeats a string a specified number of timesREVERSEReverses a string and returns the resultReverseString(Str)Right(String, len)RIGHTExtracts a number of characters from a string (starting from right)RightPad- Right pads a stringRTRIMRemoves trailing spaces from a stringSOUNDEXReturns a four-character code to evaluate the similarity of two stringsSPACEReturns a string of the specified number of space charactersSplitDelimitedString- Splits a delimited string (often CSV or TSV)SplitDelimitedStringIntoColumns- Splits a delimited string (often CSV or TSV) into separate columnsSTRReturns a number as stringSTRCSPN(x, y)StringLength- Returns the length of a string (Properly)StripDiacritics- Strips diacritics (accents, graves, etc.) from a stringStripQuotes(x)STRSPN(x, y)STUFFDeletes a part of a string and then inserts another part into the string, starting at a specified positionSubstring(x, start, length)SUBSTRINGExtracts some characters from a stringTRANSLATEReturns the string from the first argument after the characters specified in the second argument are translated into the characters specified in the third argument.Translate- Replaces a set of characters in a stringTrim(x, y)TRIMRemoves leading and trailing spaces (or other specified characters) from a stringTrimLeft(x, y)TrimRight(x, y)TrimWhitespace- Removes any leading or trailing space, tab, carriage return, and linefeed charactersUNICODEReturns the Unicode value for the first character of the input expressionUuidCreate()XMLDecodeString- XML decodes a stringXMLEncodeString- XML encodes a string