String operations

Fa strings use the same API as JavaScript strings.

Concatenation

Use + to add values to a string.

let greeting = "Hello" + " " + "world"
let label = "Score: " + 42

Common operations

let name = "Fa"
let upper = name.toUpperCase()
let lower = name.toLowerCase()
let length = name.length

Slicing and searching

let text = "hello world"
let part = text.slice(0, 5)
let hasWorld = text.includes("world")
let index = text.indexOf("world")

Replace and split

let clean = "hello-world".replace("-", " ")
let parts = "a,b,c".split(",")