Framework (A-Z)

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Class

String

Name

setCharAt()

Examples
void setup() { 
  Serial.begin(9600); 
  String str = String("CCCP");
  str.setCharAt(0,'1');
  Serial.println(str);  // Prints "1CCP"
} 

void loop() { 
  // Nothing for loop()
}
Description Sets the character at the specified index. An index ranges from 0 to the length of the string minus 1. The first character of the sequence is at index 0, the next at index 1, etc.
Syntax
setCharAt(index, ch)
Parameters
index int: the index of the character
ch char: the character
Returns none
Usage Application
Updated on July 07, 2011 11:09:08pm PDT

Creative Commons License