source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 2 years ago

Adding new version

File size: 943 bytes
Line 
1/*
2  String Case changes
3
4 Examples of how to change the case of a string
5
6 created 27 July 2010
7 modified 2 Apr 2012
8 by Tom Igoe
9
10 http://www.arduino.cc/en/Tutorial/StringCaseChanges
11
12 This example code is in the public domain.
13 */
14
15void setup() {
16  // Open serial communications and wait for port to open:
17  Serial.begin(9600);
18  while (!Serial) {
19    ; // wait for serial port to connect. Needed for native USB port only
20  }
21
22  // send an intro:
23  Serial.println("\n\nString  case changes:");
24  Serial.println();
25}
26
27void loop() {
28  // toUpperCase() changes all letters to upper case:
29  String stringOne = "<html><head><body>";
30  Serial.println(stringOne);
31  stringOne.toUpperCase();
32  Serial.println(stringOne);
33
34  // toLowerCase() changes all letters to lower case:
35  String stringTwo = "</BODY></HTML>";
36  Serial.println(stringTwo);
37  stringTwo.toLowerCase();
38  Serial.println(stringTwo);
39
40
41  // do nothing while true:
42  while (true);
43}
Note: See TracBrowser for help on using the repository browser.