Truncate Split String List

BlockStrings

Split a string into groups of a certain number of characters.

Inputs

StringRequired

String to split.

Split AfterRequired

Number of characters per group.

Example: 3

Sort

Order of the results.

OptionsNormalReverseRandomAlphabeticalReverse AlphabeticalAscending NumericDescending Numeric

Outputs

String 1

Chunked string.

String 2

Chunked string.

String 3

Chunked string.

String 4

Chunked string.

String 5

Chunked string.

String 6

Chunked string.

String 7

Chunked string.

String 8

Chunked string.

String 9

Chunked string.

String 10

Chunked string.

String 11

Chunked string.

String 12

Chunked string.

String 13

Chunked string.

String 14

Chunked string.

String 15

Chunked string.

String 16

Chunked string.

String 17

Chunked string.

String 18

Chunked string.

String 19

Chunked string.

String 20

Chunked string.

Build a bot using blocks like Truncate Split String List

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: truncate_split_string_list

Inputs

FieldInventScript nameValue
Stringtext
Split Aftersplit_aftere.g. "3"
Sortsort"Normal", "Reverse", "Random", "Alphabetical", "Reverse Alphabetical", "Ascending Numeric", "Descending Numeric"

Outputs

FieldInventScript nameValue
String 1string_1
String 2string_2
String 3string_3
String 4string_4
String 5string_5
String 6string_6
String 7string_7
String 8string_8
String 9string_9
String 10string_10
String 11string_11
String 12string_12
String 13string_13
String 14string_14
String 15string_15
String 16string_16
String 17string_17
String 18string_18
String 19string_19
String 20string_20

Example InventScript

truncateSplitString := truncate_split_string_list(Args{text: "...", split_after: 3})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "String 1: " + truncateSplitString.string_1,
})

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 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.Remap StringRemap or replace values in a string using a set of original-to-replacement pairs.Get UUIDv7 Creation TimeGet the creation time of a UUIDv7.