Remap String

BlockStrings

Remap or replace values in a string using a set of original-to-replacement pairs.

Inputs

Input StringRequired

The string to remap or replace within.

Example: hello

Mode

Remap matches the entire input; Replace finds and replaces substrings.

OptionsRemap (exact match)Replace (find & replace)
Case Sensitive

Whether matching is case sensitive.

OptionsTrueFalse
Fallback Value

Returned if no match in remap mode. Leave blank to return the original input.

Original Value 1

Value to match against.

Replacement Value 1

Value to replace with.

Original Value 2

Value to match against.

Replacement Value 2

Value to replace with.

Original Value 3

Value to match against.

Replacement Value 3

Value to replace with.

Original Value 4

Value to match against.

Replacement Value 4

Value to replace with.

Original Value 5

Value to match against.

Replacement Value 5

Value to replace with.

Original Value 6

Value to match against.

Replacement Value 6

Value to replace with.

Original Value 7

Value to match against.

Replacement Value 7

Value to replace with.

Original Value 8

Value to match against.

Replacement Value 8

Value to replace with.

Original Value 9

Value to match against.

Replacement Value 9

Value to replace with.

Original Value 10

Value to match against.

Replacement Value 10

Value to replace with.

Outputs

Result

The remapped or replaced string.

Matched

Whether any match was found.

Example: false

Build a bot using blocks like Remap String

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: remap_string

Inputs

FieldInventScript nameValue
Input Stringinpute.g. "hello"
Modemode"Remap (exact match)", "Replace (find & replace)"
Case Sensitivecase_sensitive"True", "False"
Fallback Valuefallback
Original Value 1original_1
Replacement Value 1replacement_1
Original Value 2original_2
Replacement Value 2replacement_2
Original Value 3original_3
Replacement Value 3replacement_3
Original Value 4original_4
Replacement Value 4replacement_4
Original Value 5original_5
Replacement Value 5replacement_5
Original Value 6original_6
Replacement Value 6replacement_6
Original Value 7original_7
Replacement Value 7replacement_7
Original Value 8original_8
Replacement Value 8replacement_8
Original Value 9original_9
Replacement Value 9replacement_9
Original Value 10original_10
Replacement Value 10replacement_10

Outputs

FieldInventScript nameValue
Resultresult
Matchedmatchede.g. "false"

Example InventScript

remapString := remap_string(Args{input: "hello"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Result: " + remapString.result,
})

More strings blocks

String LengthGet the length of a string in characters and in bytes.String Split ListSplit a string into a list of strings with a delimiter.Split String IteratorIterate over a string separated by a delimiter.String Contains CountCount the number of times a substring appears in a string.String ReplaceReplace a substring with a new substring within a string.String to LowercaseConvert a string to lowercase.String to UppercaseConvert a string to uppercase.String Trim PrefixRemove a prefix from a string.String Trim SuffixRemove a suffix from a string.Truncate StringTruncate a string to a certain length.Base64 EncodeEncode a string to Base64.Base64 DecodeDecode a Base64 string.Format NumberFormat a number with commas.Generate UUIDv4Generate a UUIDv4 (fully-random).Generate UUIDv7Generate a UUIDv7 (time-based).Parse ColorParse a color string (name or hex code) into a hex string.URL Query EscapeEncode a string to be used as a URL parameter.URL Query UnescapeDecode a string used as a URL parameter.Bcrypt Hash StringApply a one-way hash to a string using bcrypt.Bcrypt Compare HashCompare a string to a bcrypt hash.Verify HMACVerify a message against an HMAC signature.MD5 HashGenerate an MD5 hash of a string.Sort Lines by Number Prefix or SuffixSort lines of text by the number at the beginning or end of each line.Truncate Split String ListSplit a string into groups of a certain number of characters.Truncate Split String IteratorIterate over a string by groups of a certain number of characters.Scramble StringScramble the order of characters in a string.Random String GeneratorGenerate a random string of a specified length using a chosen character set.Repeat StringRepeat a string a specified number of times.Reverse StringReverse the characters of a string.Reorder Comma Separated ListReorder the elements in a comma separated list.Intersection of Comma Separated ListsCompare two comma separated lists and find items exclusive to each list and items common to both.Get UUIDv7 Creation TimeGet the creation time of a UUIDv7.