Articles Posted by the Author:

  • [] (存取字元元素)

    [] (存取字元元素)

    描述 允许去取得字串中的字元。 语法 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 […]


  • trim()

    trim()

    描述 得到一个去除头尾空白的字串。 trim() 会修改原字串而不是回传转换后的新字串。 语法 string.trim() 参数 string : String 物件 (字串) 回传 无回传值 范例 - StringLengthTrim See also - String 语法参考主页面 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 […]


  • toUpperCase()

    toUpperCase()

    描述 把字串中的英文字母转换成大写。 toUpperCase() 会修改原字串而不是回传转换后的新字串。 语法 string.toUpperCase() 参数 string : String 物件 (字串) 回传 无回传值 范例 - StringCaseChanges See also - String - toLowerCase() 语法参考主页面 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 […]


  • toLowerCase()

    toLowerCase()

    描述 把字串中的英文字母转换成小写。 toLowerCase() 会修改原字串而不是回传转换后的新字串。 语法 string.toLowerCase() 参数 string : String 物件 (字串) 回传 无回传值 范例 - StringCaseChanges See also - String - toUpperCase() 语法参考主页面 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 […]


  • toInt()

    toInt()

    描述 把字串转换成一个整数。输入的字串应该要以整数数字开头,假如字串中包含非整数的数字,这个函式即停止转换。 语法 string.toInt() 参数 string : String 物件 (字串) 回传 long 型别 (假如这个字串是因为开头不是整数数字而不能被转换,则回传 0) 范例 - StringToIntExample See also - String 语法参考主页面 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 […]


  • toCharArray()

    toCharArray()

    描述 复制字串中的字元到指定的阵列。 语法 string.toCharArray(buf, len) 参数 string : String 物件 (字串) buf : 指定的阵列 (char [] 型别) len : 阵列大小 (unsigned int 型别) 回传 无回传值 See also - String - getBytes() 语法参考主页面 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. […]


  • substring()

    substring()

    描述 从原字串中撷取一段字串。你可以指定一个开始位置 (撷取的字串会包含开始位置的字元) 以及结束位置 (撷取的字串不会包含结束位置的字元。假如没有输入结束位置,预设会撷取至字串结尾之前。 语法 string.substring(from) string.substring(from, to) 参数 string : String 物件 (字串) from : 字串撷取的开始位置 (包含开始位置的字元) to (非必要的): 字串撷取的结束位置 (不包含结束位置的字元) 回传 撷取后的字串 范例 - StringSubstring See also - String 语法参考主页面 The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 […]


  • startsWith()

    startsWith()

    描述 测试字串是否以指定的字元 (或字串) 做为开头。 语法 string.startsWith(string2) 参数 string : String 物件 (字串) string2 : 另一个 String 物件 (字串) 回传 true: 假如 string 是以 string2 为开头 false: 与上面相反 范例 - StringStartsWithEndsWith See also - String - endsWith() Language Reference Home The text of the 86Duino reference is a modification of the Arduino reference, and is licensed […]


  • setCharAt()

    setCharAt()

    描述 把字串中指定位置的字元设定成另一个字元。这不会影响字串的长度。 语法 string.setCharAt(index, c) 参数 string : String 物件 (字串) index : 指定的字元位置 c : 另一个字元 回传 无回传值 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 […]


  • reserve()

    reserve()

    描述 String 物件的 reserve() 函式可以配置一块记忆体空间来存放字串。 语法 string.reserve(size) 参数 string : String 物件 (字串) size : 要配置的记忆体大小 (用来存放字串) unsigned int 型别 回传 无回传值 范例 See also - String 语法参考主页面 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 […]