Sv Split

< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Splits the specified string based on the specified delimiter(s) and returns a regular array (list array) containing all substrings. Each character in the set of delimiters is matched individually, not as the complete string it is passed as.

Syntax

(array) Sv_Split ToSplit:string Delimiters:string

Example

string_var my_string
array_var substrings

let my_string := "What's he building in there?"

let substrings := Sv_Split my_string, " " ; * split on 'space'

; * substrings contains: "What's", "he", "building", "in", "there?"
let my_string := "He never waves when he goes by. He's hiding something from the rest of us, and I think I know why."

let substrings := Sv_Split my_string, ",." ; * 2 delimiters

; * substrings contains: "He never waves when he goes by", " He's hiding something from the rest of us", " and I think I know why"

See Also