Skip to content
Get on GitHub Autodesk App Store - coming soon

String

36 nodes. Types ending in [] are lists. An input with a default is optional.

Nodes

String.Concat

Joins two strings into one. A missing value counts as empty text, also a gap in a list (a column with blank cells keeps every row).

Inputs

Input Type Default What it does
a required string — First string. A missing (null) value counts as empty text, also for the gaps of a list.
b required string — Second string. A missing (null) value counts as empty text, also for the gaps of a list.

Outputs

Output Type What it gives
result string The two strings joined together.

Tags: concatenate join append +

String.Contains

Tests whether a string contains the given substring. Ignores case unless ignoreCase is switched off.

Inputs

Input Type Default What it does
text required string — The string to search in.
searchFor required string — The substring to look for.
ignoreCase boolean true True (default) to compare case-insensitively.

Outputs

Output Type What it gives
result boolean True when the substring occurs in the string.

Tags: substring search find

String.EndsWith

Tests whether a string ends with the given suffix. Ignores case unless ignoreCase is switched off.

Inputs

Input Type Default What it does
text required string — The string to test.
searchFor required string — The suffix to look for.
ignoreCase boolean true True (default) to compare case-insensitively.

Outputs

Output Type What it gives
result boolean True when the string ends with the suffix.

Tags: suffix trailing extension

String.Format

Fills a .NET composite format such as "{0} is {1:0.00} m" with the wired values (invariant culture, "{{" and "}}" are literal braces). It makes one text: all the wired values, and the items of a list wired to 'values', fill {0}, {1}, ... of that one text, and a missing value becomes empty text. For one text per row, wire the rows (a list of lists, for example Table.Rows) to 'values' and set its List Levels to @L2, or use String.Template with Table.ToDictionaries.

Inputs

Input Type Default What it does
format required string — The composite format text, e.g. "Wall {0} is {1:0.00} m high".
values any number of wires required any[] — The values for {0}, {1}, ... in the order they are wired. For one text per row, wire a list of rows (a list of lists, for example from Table.Rows) and set this input's List Levels to @L2.

Outputs

Output Type What it gives
text string The formatted text.

Tags: sprintf interpolate placeholder compose message text

String.FromNumber

Formats a number as text with fixed decimals, an optional thousands separator and a prefix/suffix (invariant culture). Formerly called Number.Format; String.ToNumber is the way back.

Inputs

Input Type Default What it does
number required number — The number to format.
decimals integer 2 Digits after the decimal point, 0 to 15 (the number is rounded).
thousandsSeparator boolean false True to group the digits in thousands with ",".
prefix string "" Text placed before the number (and its sign), e.g. "EUR ".
suffix string "" Text placed after the number, e.g. " m2".

Outputs

Output Type What it gives
text string The formatted text.

Tags: number.format number format format number number to text round decimals currency unit thousands tostring display format

String.FromObject

Converts any value (including whole lists) to its display string.

Inputs

Input Type Default What it does
obj required any — The value to format.

Outputs

Output Type What it gives
result string The formatted text ("null" for null).

Tags: tostring format text

String.IndexOf

Returns the zero-based index of the first occurrence of a text (-1 when absent). Ignores case unless ignoreCase is switched off.

Inputs

Input Type Default What it does
text required string — The text to search in.
search required string — The text to look for.
ignoreCase boolean true True (default) to ignore upper/lower case.
startIndex integer 0 Zero-based index to start searching at (0 to the text's length).

Outputs

Output Type What it gives
index integer The zero-based index of the first occurrence, or -1 when it is absent.

Tags: find position locate search first

String.IsBlank

Tests whether a text is null, empty or only whitespace. With a list it tests every item and a gap in the list counts as blank, so a column of cells gives one true or false per cell.

Inputs

Input Type Default What it does
text required string — The text to test. A list is tested item by item, and a gap in the list (a blank spreadsheet cell) counts as blank.

Outputs

Output Type What it gives
isBlank boolean True when the text is null, empty or only whitespace.

Tags: empty null whitespace missing has value validate

String.Join

Joins the elements of a list into a single string with a separator. A missing value becomes empty text ("a,,c"), as in String.Concat.

Inputs

Input Type Default What it does
separator required string — Text placed between elements.
list any number of wires required any[] — The values to join; non-strings are formatted invariantly and a missing (null) value becomes empty text, as in String.Concat.

Outputs

Output Type What it gives
result string The joined string.

Tags: concatenate combine delimiter

String.LastIndexOf

Returns the zero-based index of the last occurrence of a text (-1 when absent). Ignores case unless ignoreCase is switched off.

Inputs

Input Type Default What it does
text required string — The text to search in.
search required string — The text to look for.
ignoreCase boolean true True (default) to ignore upper/lower case.

Outputs

Output Type What it gives
index integer The zero-based index of the last occurrence, or -1 when it is absent.

Tags: find position locate search last extension

String.Left

Returns the first characters of a text (the whole text when the count is larger).

Inputs

Input Type Default What it does
text required string — The text to take from.
count required integer — How many characters to take (0 or more).

Outputs

Output Type What it gives
text string The first count characters.

Tags: first start prefix head take substring

String.Length

Returns the number of characters in a string.

Inputs

Input Type Default What it does
text required string — The string to measure.

Outputs

Output Type What it gives
result integer The number of characters.

Tags: count size

String.Lines

Splits a text into a list of lines (handles \r\n, \n and \r), optionally dropping the empty ones.

Inputs

Input Type Default What it does
text required string — The text to split.
removeEmpty boolean false True to drop lines that are empty (lines holding only spaces are kept).

Outputs

Output Type What it gives
lines string[] The lines, without their line breaks.

Tags: split newline linebreak rows paragraph multiline

String.PadLeft

Pads a text on the left with a character up to a total width ("7" becomes "007" with width 3 and padChar 0).

Inputs

Input Type Default What it does
text required string — The text to pad.
width required integer — The wanted total length; a longer text is returned unchanged.
padChar string " " The padding character: exactly one character (default a space).

Outputs

Output Type What it gives
text string The padded text.

Tags: pad zero leading align fill right-align

String.PadRight

Pads a text on the right with a character up to a total width.

Inputs

Input Type Default What it does
text required string — The text to pad.
width required integer — The wanted total length; a longer text is returned unchanged.
padChar string " " The padding character: exactly one character (default a space).

Outputs

Output Type What it gives
text string The padded text.

Tags: pad trailing align fill left-align column

String.RegexIsMatch

Tests whether a .NET regular expression matches anywhere in a text (use ^ and $ to match the whole text). Case-sensitive unless ignoreCase is switched on (String.Contains and String.IndexOf ignore case by default).

Inputs

Input Type Default What it does
text required string — The text to test.
pattern required string — The .NET regular expression, e.g. "^[A-Z]{2}-\d+$".
ignoreCase boolean false True to ignore upper/lower case (off by default: regular expressions are case-sensitive).

Outputs

Output Type What it gives
isMatch boolean True when the pattern matches somewhere in the text.

Tags: regex regexp pattern match test validate wildcard

String.RegexMatch

Finds the first match of a regular expression: whether it was found, the matched text and the capture groups 1..n. Case-sensitive unless ignoreCase is switched on.

Inputs

Input Type Default What it does
text required string — The text to search.
pattern required string — The .NET regular expression, e.g. "(\d+)-(\w+)".
ignoreCase boolean false True to ignore upper/lower case (off by default: regular expressions are case-sensitive).

Outputs

Output Type
found boolean
match string
groups string[]

Returns: Dictionary with "found", "match" and "groups".

Tags: regex regexp pattern capture group extract parse find

String.RegexMatches

Returns the text of every match of a regular expression as a list (empty when nothing matches). Case-sensitive unless ignoreCase is switched on.

Inputs

Input Type Default What it does
text required string — The text to search.
pattern required string — The .NET regular expression, e.g. "\d+".
ignoreCase boolean false True to ignore upper/lower case (off by default: regular expressions are case-sensitive).

Outputs

Output Type What it gives
matches string[] The text of every match, in order (empty when nothing matches).

Tags: regex regexp pattern findall extract all numbers

String.RegexReplace

Replaces every match of a regular expression; $1, $2, ... in the replacement insert the capture groups. Case-sensitive unless ignoreCase is switched on.

Inputs

Input Type Default What it does
text required string — The text to change.
pattern required string — The .NET regular expression to replace.
replacement required string — The replacement text; $1, $2, ... insert capture groups.
ignoreCase boolean false True to ignore upper/lower case (off by default: regular expressions are case-sensitive).

Outputs

Output Type What it gives
text string The text with every match replaced.

Tags: regex regexp pattern substitute rename clean sub

String.RegexSplit

Splits a text into a list of parts wherever a regular expression matches. Case-sensitive; start the pattern with (?i) to ignore case.

Inputs

Input Type Default What it does
text required string — The text to split.
pattern required string — The .NET regular expression that separates the parts, e.g. "[,;]\s*".

Outputs

Output Type What it gives
list string[] The parts between the matches.

Tags: regex regexp pattern tokenize divide delimiter separator

String.RemoveDiacritics

Removes accents from letters ("é" becomes "e") so names compare and sort without them.

Inputs

Input Type Default What it does
text required string — The text to clean.

Outputs

Output Type What it gives
text string The text without diacritics.

Tags: accents umlaut ascii normalize normalise latin strip

String.Repeat

Repeats a text a number of times (0 to 10000), optionally with a separator between the copies.

Inputs

Input Type Default What it does
text required string — The text to repeat.
count required integer — How many copies, 0 to 10000 (0 gives an empty text).
separator string "" Text placed between two copies.

Outputs

Output Type What it gives
text string The repeated text.

Tags: duplicate multiply fill line dashes times

String.Replace

Replaces all occurrences of a substring with another string. Case-sensitive unless ignoreCase is switched on.

Inputs

Input Type Default What it does
text required string — The string to modify.
searchFor required string — Substring to replace (must not be empty).
replaceWith required string — Replacement text.
ignoreCase boolean false True to find the substring whatever its upper/lower case (off by default: the search is case-sensitive).

Outputs

Output Type What it gives
result string The string with all occurrences replaced.

Tags: substitute swap

String.Reverse

Reverses the characters of a text.

Inputs

Input Type Default What it does
text required string — The text to reverse.

Outputs

Output Type What it gives
text string The reversed text.

Tags: backwards mirror flip invert

String.Right

Returns the last characters of a text (the whole text when the count is larger).

Inputs

Input Type Default What it does
text required string — The text to take from.
count required integer — How many characters to take (0 or more).

Outputs

Output Type What it gives
text string The last count characters.

Tags: last end suffix tail take substring

String.Split

Splits a string into a list of substrings around a separator. Empty parts are kept unless removeEmpty is on; trim removes the spaces around every part ("a, b ,c" with separator "," and trim gives a, b, c).

Inputs

Input Type Default What it does
text required string — The string to split.
separator required string — Separator text.
removeEmpty boolean false True to drop the empty parts, so "a,b,,c" gives three parts (off by default).
trim boolean false True to remove the spaces around every part, so "a, b ,c" gives a, b and c (off by default). Trimming happens before the empty parts are dropped, so a part of only spaces counts as empty.

Outputs

Output Type What it gives
list string[] The list of segments.

Tags: tokenize divide delimiter csv comma

String.StartsWith

Tests whether a string starts with the given prefix. Ignores case unless ignoreCase is switched off.

Inputs

Input Type Default What it does
text required string — The string to test.
searchFor required string — The prefix to look for.
ignoreCase boolean true True (default) to compare case-insensitively.

Outputs

Output Type What it gives
result boolean True when the string starts with the prefix.

Tags: prefix begins leading

String.Substring

Extracts part of a string from a start index (-1 length = to the end). A length that runs past the end gives what is left, like String.Left and String.Right; a start index beyond the end of the text is an error.

Inputs

Input Type Default What it does
text required string — The string to slice.
startIndex required integer — Zero-based index of the first character to take (0 to the text's length).
length integer -1 Number of characters to take; -1 = to the end. More than the text has left gives what is left.

Outputs

Output Type What it gives
result string The extracted substring.

Tags: slice extract mid part

String.Template

Replaces {name} placeholders in a text with the values of a dictionary ("{{" and "}}" are literal braces).

Inputs

Input Type Default What it does
template required string — The text with {name} placeholders, e.g. "Level {level}: {count} clashes".
dictionary required IDictionary — The values by name.
onMissing string "keep" "keep" leaves the placeholder as written, "empty" replaces it with nothing, "error" fails.

Outputs

Output Type What it gives
text string The text with the placeholders replaced.

Tags: placeholder mustache merge interpolate fill replace report message

String.ToLower

Converts a string to lowercase.

Inputs

Input Type Default What it does
text required string — The string to convert.

Outputs

Output Type What it gives
result string The lowercase string.

Tags: lowercase case

String.ToNumber

Converts a numeric string to a number. By default the whole text must be a plain number with a decimal point ("3.14", "-2", "1.5e3"). Set decimalSeparator to "," for a decimal comma ("1,5"). Switch ignoreUnits on to take the first number out of a text with a unit or a label ("12.5 mm" gives 12.5, "approx. 1,234.5 m" gives 1234.5; thousands separators are read only in this mode). A text without a number still fails; the row shows a warning.

Inputs

Input Type Default What it does
text required string — The text to parse, e.g. "3.14".
decimalSeparator string "." The decimal separator of the text: "." (default, "3.14") or "," ("1,5").
ignoreUnits boolean false True to read the first number in the text and ignore the rest, so "12.5 mm" gives 12.5 (off by default: the whole text must be the number). Thousands separators ("1,234.5 m") are read only in this mode.

Outputs

Output Type What it gives
result number The parsed number.

Tags: parse convert double extract number decimal comma units

String.ToTitleCase

Capitalises the first letter of every word and lowercases the rest ("bim COORDINATION" becomes "Bim Coordination").

Inputs

Input Type Default What it does
text required string — The text to convert.

Outputs

Output Type What it gives
text string The text in title case.

Tags: capitalize capitalise proper case words heading

String.ToUpper

Converts a string to uppercase.

Inputs

Input Type Default What it does
text required string — The string to convert.

Outputs

Output Type What it gives
result string The uppercase string.

Tags: uppercase capital case

String.Trim

Removes whitespace (or the given characters) from both ends of a string. See String.TrimStart and String.TrimEnd for one end only.

Inputs

Input Type Default What it does
text required string — The string to trim.
chars string "" The characters to remove (each character of this text counts); empty means whitespace.

Outputs

Output Type What it gives
result string The trimmed string.

Tags: whitespace strip clean

String.TrimEnd

Removes whitespace (or the given characters) from the end of a text.

Inputs

Input Type Default What it does
text required string — The text to trim.
chars string "" The characters to remove (each character of this text counts); empty means whitespace.

Outputs

Output Type What it gives
text string The trimmed text.

Tags: trim strip trailing right clean whitespace

String.TrimStart

Removes whitespace (or the given characters) from the start of a text.

Inputs

Input Type Default What it does
text required string — The text to trim.
chars string "" The characters to remove (each character of this text counts); empty means whitespace.

Outputs

Output Type What it gives
text string The trimmed text.

Tags: trim strip leading left clean whitespace