-
Notifications
You must be signed in to change notification settings - Fork 0
splitString
ffredyk edited this page Jul 23, 2026
·
1 revision
String
Binary — <string> splitString <separator>.
Also accepts array form: splitString [string, separator].
<string> splitString <string>
splitString <array> // [string, separator]
Splits a string by the given separator into an array of substrings. Returns the array. If the separator is not found, returns an array with the original string as the single element.
Calls string.Split(separator, StringSplitOptions.None) with ordinal comparison. Empty strings between consecutive separators are preserved (unlike StringSplitOptions.RemoveEmptyEntries).
"a,b,c" splitString ","; // ["a", "b", "c"]
splitString ["a,b,c", ","]; // same, array form_line = "John,Doe,42,Engineer";
_fields = _line splitString ",";
_name = _fields select 0; // "John"
_age = parseNumber (_fields select 2); // 42_path = "scripts\ai\combat.sqf";
_parts = _path splitString "\";
_filename = _parts select (count _parts - 1); // "combat.sqf"_data = "key=value;name=test;hp=100";
_pairs = _data splitString ";";
_pairs forEach {
_kv = _x splitString "=";
systemChat f"{_kv select 0} -> {_kv select 1}";
};_words = "the quick brown fox" splitString " ";
count _words; // 4ReadOnly — pure computation, returns new array. Safe from any scheduler.
- joinString — reverse: join array into string
- find — find substring position
- in — substring check
- select — access characters
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo