Description Get a substring of a String. The starting index is inclusive (the corresponding character is included in the substring), but the optional ending index is exclusive (the corresponding character is not included in the substring). If the ending index is omitted, the substring continues to the end of the String. Syntax string.substring(from) string.substring(from, to) […]
Description Tests whether or not a String starts with the characters of another String. Syntax string.startsWith(string2) Parameters string : a variable of type String string2 : another variable of type String Returns true: if string starts with the characters of string2 false: otherwise Example - StringStartsWithEndsWith See also - String - endsWith() Language Reference Home […]
Description Sets a character of the String. Has no effect on indices outside the existing length of the String. Syntax string.setCharAt(index, c) Parameters string : a variable of type String index : the index to set the character at c : the character to store to the given location Returns None See also - String […]
Description The String reserve() function allows you to allocate a buffer in memory for manipulating strings. Syntax string.reserve(size) Parameters string : a variable of type String size : unsigned int declaring the number of bytes in memory to save for string manipulation Returns none Example See also - String Language Reference Home The text of […]
Description The String replace() function allows you to replace all instances of a given character with another character. You can also use replace to replace substrings of a string with a different substring. Syntax string.replace(substring1, substring2) Parameters string : a variable of type String substring1 : another variable of type String substring2 : another variable […]
Description Returns the length of the String, in characters. (Note that this doesn’t include a trailing null character.) Syntax string.length() Parameters string : a variable of type String Returns The length of the String in characters. Example - StringLengthTrim Language Reference Home The text of the 86Duino reference is a modification of the Arduino reference, […]
Description Locates a character or String within another String. By default, searches from the end of the String, but can also work backwards from a given index, allowing for the locating of all instances of the character or String. Syntax string.lastIndexOf(val) string.lastIndexOf(val, from) Parameters string : a variable of type String val : the value […]
Description Locates a character or String within another String. By default, searches from the beginning of the String, but can also start from a given index, allowing for the locating of all instances of the character or String. Syntax string.indexOf(val) string.indexOf(val, from) Parameters string : a variable of type String val : the value to […]
Description Copies the string’s characters to the supplied buffer. Syntax string.getBytes(buf, len) Parameters string : a variable of type String buf : the buffer to copy the characters into (byte []) len : the size of the buffer (unsigned int) Returns None See also - String - toCharArray() Language Reference Home The text of the […]
Description Compares two strings for equality. The comparison is not case-sensitive, meaning the String(“hello”) is equal to the String(“HELLO”). Syntax string.equalsIgnoreCase(string2) Parameters string : a variable of type String string2 : another variable of type String Returns true: if string equals string2 (ignoring case) false: otherwise Example - StringComparisonOperators See also - String - equals() […]