String Functions
- [String] Alteryx
- [Strings] SDU
- String Functions SQL Server
"STRING CONVERSION"
Matrix of Formats
Html to Text
XML to JSON
JSON to CSV
CSV to Markdown
Markdown to Html
Text to XML
"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 camelCaseCobolCase
- Converts a string to COBOL-CASEKebabCase
- Converts a string to kebab-caseLower
ToLower
-LowerCase(x)
LCase(x)
PascalCase
- Converts a string to PascalCaseProperCase
- Converts a string to Proper CaseScreamingSnakeCase
- Converts a string to SCREAMING_SNAKE_CASESentenceCase
- Converts a string to "Sentence case." --via-minima.SeparateByCase
- Inserts spaces in Pascal-cased or camel-cased stringsSnakeCase
- Converts a string to snake_caseSingleSpaceWords
- Trims a string and replaces multiple spaces with single spacesSpongeBobSnakeCase
- Converts a string to sPoNgEbOb_sNaKeCaSeTitleCase(x)
TitleCase
- Converts a string to Title CaseTrainCase
- Converts a string to Train-CaseUPPER
Converts a string to upper-caseUppercase(x) Converts a string to upper case
capitalize
() Converts the first character to upper casecasefold
() Converts string into lower case
Spacing and Alignment
center
() Returns a centered stringexpandtabs
() Sets the tab size of the stringSingleSpaceWords
- 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 valueEndsWith(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
SLUGGIFY is like this -- it's a mapping to a smaller but still big enough map.
AlphabeticOnly
- Removes any non-alphabetic characters from a stringAlphanumericOnly
- Removes any non-alphanumeric characters from a stringAsciiOnly
- Removes non-ASCII characters from a stringStrip
Lookups
ASCII
Returns the ASCII value for the specific characterCHAR
Returns the character based on the ASCII codeCHARINDEX
Returns the position of a substring in a stringConcat with +
Adds two or more strings togetherCONCAT_WS
Adds two or more strings together with a separatorCONCAT
Adds two or more strings togetherCountWords(String)
CountWords
- Counts the number of words in a stringDATALENGTH
Returns the number of bytes used to represent an expressionDecomposeUnicodeForMatch(String)
DIFFERENCE
Compares two SOUNDEX values, and returns an integer valueDigitsOnly
- Removes non-digit characters from a stringExtractToken
- 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)
FORMAT
Formats 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)
LEFT
Extracts a number of characters from a string (starting from left)LeftPad
- Left pads a stringLEN
Returns the length of a stringLength(x)
LOWER
Converts a string to lower-caseLowerCase(x)
LTRIM
Removes leading spaces from a stringMD5_ASCII(String)
MD5_UNICODE(String)
NCHAR
Returns 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)
PATINDEX
Returns 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 positionQUOTENAME
Returns 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)
REPLACE
Replaces all occurrences of a substring within a string, with a new substringReplaceChar(x, y, z)
ReplaceFirst(Str, Target, Replacement)
REPLICATE
Repeats a string a specified number of timesREVERSE
Reverses a string and returns the resultReverseString(Str)
Right(String, len)
RIGHT
Extracts a number of characters from a string (starting from right)RightPad
- Right pads a stringRTRIM
Removes trailing spaces from a stringSOUNDEX
Returns a four-character code to evaluate the similarity of two stringsSPACE
Returns 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 columnsSTR
Returns 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)
STUFF
Deletes a part of a string and then inserts another part into the string, starting at a specified positionSubstring(x, start, length)
SUBSTRING
Extracts some characters from a stringTRANSLATE
Returns 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)
TRIM
Removes 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 charactersUNICODE
Returns the Unicode value for the first character of the input expressionUuidCreate()
XMLDecodeString
- XML decodes a stringXMLEncodeString
- XML encodes a string