remapString := remap_string(Args{input: "hello"})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Result: " + remapString.result,
})
Remap String
Remap or replace values in a string using a set of original-to-replacement pairs.
Inputs
The string to remap or replace within.
Example: hello
Remap matches the entire input; Replace finds and replaces substrings.
Whether matching is case sensitive.
Returned if no match in remap mode. Leave blank to return the original input.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Value to match against.
Value to replace with.
Outputs
The remapped or replaced string.
Whether any match was found.
Example: false
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
remap_stringInputs
| Field | InventScript name | Value |
|---|---|---|
| Input String | input | e.g. "hello" |
| Mode | mode | "Remap (exact match)", "Replace (find & replace)" |
| Case Sensitive | case_sensitive | "True", "False" |
| Fallback Value | fallback | |
| Original Value 1 | original_1 | |
| Replacement Value 1 | replacement_1 | |
| Original Value 2 | original_2 | |
| Replacement Value 2 | replacement_2 | |
| Original Value 3 | original_3 | |
| Replacement Value 3 | replacement_3 | |
| Original Value 4 | original_4 | |
| Replacement Value 4 | replacement_4 | |
| Original Value 5 | original_5 | |
| Replacement Value 5 | replacement_5 | |
| Original Value 6 | original_6 | |
| Replacement Value 6 | replacement_6 | |
| Original Value 7 | original_7 | |
| Replacement Value 7 | replacement_7 | |
| Original Value 8 | original_8 | |
| Replacement Value 8 | replacement_8 | |
| Original Value 9 | original_9 | |
| Replacement Value 9 | replacement_9 | |
| Original Value 10 | original_10 | |
| Replacement Value 10 | replacement_10 |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Result | result | |
| Matched | matched | e.g. "false" |