创客百科

姿势共享,有节操无门槛参与的创客百科,创客动力之源 \ (^_^) /

用户工具

站点工具


en:arduino:language:stringobject

String

Description

The String class, part of the core as of version 0019, allows you to use and manipulate strings of text in more complex ways than character arrays do. You can concatenate Strings, append to them, search for and replace substrings, and more. It takes more memory than a simple character array, but it is also more useful.

For reference, character arrays are referred to as strings with a small s, and instances of the String class are referred to as Strings with a capital S. Note that constant strings, specified in “double quotes” are treated as char arrays, not instances of the String class.

Functions

  • String()
  • charAt()
  • compareTo()
  • concat()
  • endsWith()
  • equals()
  • equalsIgnoreCase()
  • getBytes()
  • indexOf()
  • lastIndexOf()
  • length()
  • replace()
  • setCharAt()
  • startsWith()
  • substring()
  • toCharArray()
  • toLowerCase()
  • toUpperCase()
  • trim()

Operators

  • [] (element access)
  • + (concatenation)
  • == (comparison)

Examples

  • StringConstructors
  • StringAdditionOperator
  • StringIndexOf
  • StringAppendOperator
  • StringLengthTrim
  • StringCaseChanges
  • StringReplace
  • StringCharacters
  • StringStartsWithEndsWith
  • StringComparisonOperators
  • StringSubstring

Reference Home

本页面的其他翻译:
en/arduino/language/stringobject.txt · 最后更改: 2016/12/25 22:15 (外部编辑)