[] (存取字元元素)

描述

允許去取得字串中的字元。

語法


char thisChar = string1[n]

參數

thisChar (char 型別) – 字元變數
string1 – String 物件 (字串)
n (int 型別) – 數字變數

回傳

字串中第 n 個字元。與呼叫 charAt() 的結果相同。

範例

StringCharacters

See also

String
charAt()


語法參考主頁面

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.