Arduino

Reference Language | Libraries | Comparison | Changes

## 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. #### Examples StringConstructors StringAdditionOperator StringIndexOf StringAppendOperator StringLengthTrim StringCaseChanges StringReplace StringRemove StringCharacters StringStartsWithEndsWith StringComparisonOperators StringSubstring #### See Also string: character arrays Variable Declaration | #### Functions String() charAt() compareTo() concat() c_str() endsWith() equals() equalsIgnoreCase() getBytes() indexOf() lastIndexOf() length() remove() replace() reserve() setCharAt() startsWith() substring() toCharArray() toInt() toFloat() toLowerCase() toUpperCase() trim() #### Operators [] (element access) + (concatenation) += (append) == (comparison) > (greater than) >= (greater than or equal to) < (less than) <= (less than or equal to) != (different from)

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

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

### Share

### This link has expired.
Please re-subscribe to our Newsletters.

### Subscribe to our Newsletters

Email

Please enter a valid email to subscribe

Arduino Newsletter
Arduino Store Newsletter

### Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy

###### Newsletter

- ©2015 Arduino
- Copyright Notice
- Contact us
- About us
- Careers