Text Splitting

Text splitting functions are useful for advanced codes that deal with multiple user arguments, or even adjusting function outputs (for advanced users). This wiki includes information on how to use these functions.

Functions

$textSplit[]

$textSplit[text;splitter]

Splits the text into sections by a splitter.

$splitText[]

$splitText[index]

Retrieves a value from $textSplit.

🧙‍♂️ You can also use $splitText[>] to retrieve the last value of the split.

$getTextSplitLength

$getTextSplitLength

Returns how many splits there are in $textSplit. Here's a example:

$textSplit[hello world | hello planet | hello earth;|]
$getTextSplitLength

example

$removeSplitTextElement[]

$removeSplitTextElement[index]

Removes a element from $splitText. Here's a example:

$textSplit[hello world | hello planet | hello earth;|]
$removeSplitTextElement[1]
1: $splitText[1]
2: $splitText[2]

example

$joinSplitText

$joinSplitText[splitter]

Joins $textSplit values with provided 'splitter'. Here's a example:

$textSplit[hello world | hello planet | hello earth;|]
$joinSplitText[+]

example

Examples

Example #1

$textSplit[hello world | hello planet | hello earth;|]
1: $splitText[1]
2: $splitText[2]
3: $splitText[3]

example

Example #2

$textSplit[text1-text2-text3-text4;-]
1: $splitText[1]
2: $splitText[2]
3: $splitText[3]
4: $splitText[4]
Length: $getTextSplitLength

example

Advanced

Splitting via Spaces

In $textSplit, BDFD reads spaces differently. Here's a example:

$textSplit[this is some text; ]

Instead of splitting the text by each space, it splits the text by each character.

To prevent this from happening, you can use the code below:

$textSplit[$replaceText[text; ;,;-1];,]
$c[Replace 'text' with your text.]

Example using this method:

$textSplit[$replaceText[hello hey hi; ;,;-1];,]
1: $splitText[1]
2: $splitText[2]
3: $splitText[3]

example