Verse Wiki — the Verse handbook for Blueprint authors
EXTRA

Build Your Own Split: A Community String Utility

"How do I split "red,green,blue" on the commas?" — a perennial forum question with a surprising answer: the Verse standard library has no Split; you write it yourself. The good news: the wheel is barely a dozen lines, and building it drills every skill from Lesson 10 in one go.

1. Split Is Missing: You Didn't Overlook It — It Really Isn't There

If you've done string handling in Blueprint, your first move for a split-on-delimiter job is probably digging through the String node library for a Split node. In Verse, though, the standard library genuinely has no such ready-made feature — and no amount of hitting Compile will conjure one. Someone on the Epic developer forums asked outright, "any way to split a string?", and the moderator's reply was blunt: the method doesn't exist in the official docs — implement it yourself. Also missing: Replace, Contains, ToUpper / ToLower — Verse's string toolbox is restrained to the point of asceticism.

Seen from another angle, though, this is a practice problem delivered to your door. Because a string's true form is []char (an array of characters), whatever an array can do, it can do: walk it character by character with a ForEach, count it with .Length, safely grab a character by index inside a Branch (if). Add interpolation to splice characters into a word (set Word += "{Ch}" is just wiring in a Set node), and Lesson 10 has already handed you every part needed to hand-build a Split.

2. The Community-Standard Recipe: Scan Character by Character, Build Words

The idea is manual sentence-chopping: scan the characters start to finish; anything that isn't the separator gets spliced into the current word; the moment you hit the separator, toss the word you've built into the result array and start building the next one from scratch.

string_tools.verse
Split(Text:string, Separator:char):[]string =
    var Words:[]string = array{}
    var Word:string = ""
    for (Ch : Text):
        if (Ch = Separator):
            # Hit the separator: current word is done, bank it
            set Words = Words + array{Word}
            set Word = ""
        else:
            # Regular character: splice it into the current word via interpolation
            set Word += "{Ch}"
    # Wrap-up: the last word has no separator after it — don't forget it
    set Words = Words + array{Word}
    Words

Line by line, every piece is an old friend from Lesson 10:

for (Ch : Text) — string is just []char (a character array), so it runs like a ForEach, the Loop Body receiving one character (char) per pass.
if (Ch = Separator) — checking whether two characters are equal is a test that might not hold, so it goes into a Branch (written if in Verse): equal takes one wire, not-equal takes the other.
set Word += "{Ch}" — a single character can't attach to text directly; brace interpolation converts it to a string first, then a Set node appends it to the current word's tail. The single most classic move in community implementations.
Words + array{Word} — array addition attaches the new word to the end of the result array; the last line, a bare Words, hands it straight back as this function's return value (Verse never needs an explicit return call).

Calling it looks like this:

split_demo_device.verse
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Diagnostics }

split_demo_device := class(creative_device):

    OnBegin<override>()<suspends>:void =
        Colors := Split("red,green,blue", ',')
        for (Color : Colors):
            Print("Split out: {Color}")

Blueprint translation: when the game starts (Event BeginPlay), call the Split function you just wrote to break "red,green,blue" on the comma ',' into a string array Colors; then a ForEach (for) walks it, using Print String on each entry to output "Split out: xxx".

The log prints Split out: red, Split out: green, Split out: blue in turn. One detail worth noticing: the wrap-up banks the final word unconditionally, so Split("a,b,", ',') yields a, b and an empty string — the same as Split in most languages. To filter out empty words, add an if (Word.Length > 0) before banking — a one-line tweak.

Epic's official community snippets section also carries a ready-made "Verse String Split Function" built on exactly the same idea; the forum-thread version additionally demonstrates another approach: instead of a ForEach, fetch by index with Text[Index] one position at a time (run off the end and the fetch fails, so the loop stops). Both are worth a read — they are the most authentic samples of community Verse style.

More importantly, this scan-and-accumulate pattern is a universal solvent: tweak the comparison slightly and you can derive a whole family of tools the standard library lacks — Contains (clock out early once the target sequence is found), Replace (swap matched segments for new text and splice it back together), Trim (skip leading and trailing whitespace). Hand-write Split once and you can supply most of the remaining string methods yourself — no more envying other languages' toolboxes.

3. Pop Quiz ★

Why can for (Ch : Text) (Blueprint's ForEach Loop) iterate a string character by character?

What is the line set Word += "{Ch}" (a Set node) in the implementation doing?

Sources & Further Reading

This page draws on the Epic developer forums and the official community snippets:

Forum thread: Any way to split a string? ↗
Official community snippet: Verse String Split Function ↗