字串是用來存放文字的。文字必須放置於雙引號 (") 之間,且不能分割成不同行。如果要在字串中包含雙引號,請使用兩個連續的雙引號來表示。
"This is a string." "123" "The word ""hello"" is quoted."
您可以藉由指定字元位置或範圍,從字串中抽出單一元素或子字串。允許有負值,表示指定從字串的尾端開始。
"hello" (2) 'Equal to "e" "hello" (-5) 'Equal to "h" "604-555-1234" (1 to 3) 'Equal to "604" "abcdef" (-3 to -1) 'Equal to "def"
您也可以使用 Left、Right 及 Mid 函式,從字串中抽出子字串。