Tutorial.StringCharacters History

Hide minor edits - Show changes to output

August 27, 2015, at 01:04 PM by Simone Maiocchi -
Changed lines 79-80 from:
* [[StringToIntExample|StringToInt]] - Allows you to convert a String to an integer number.
to:
* [[StringToInt]] - Allows you to convert a String to an integer number.
August 27, 2015, at 12:36 PM by Simone Maiocchi -
Changed lines 1-6 from:
(:div class=breadcrumb:)
[[Tutorial.HomePage | Tutorials]] > [[Tutorial.Examples | Examples]] > Strings > StringCharacters
(:divend:)

(:*toc:)
to:
(:html:)

<div class="subHeader row">

<div class="breadcrumb columns large-10 medium-10">
<p>
<a class="wikilink" href="/en/Tutorial/HomePage">Tutorials </a>
> <a class="wikilink" href="/en/Tutorial/BuiltInExamples"> Built-In Examples </a> > 08.Strings > StringCharacters
</p>
</div>
</div>

(:htmlend:)
Changed line 40 from:
(:div class=circuit :)
to:
(:div class=BOM :)
Added lines 45-46:
(:divend:)
Changed lines 66-77 from:
* [[Reference/StringObject|String object]]
* [[StringConstructors]]
* [[StringAdditionOperator]]
* [[StringIndexOf]]
* [[StringAppendOperator]]
* [[StringLengthTrim]]
* [[StringCaseChanges]]
* [[StringReplace]]
* [[StringCharacters]]
* [[StringStartsWithEndsWith]]
* [[StringComparisonOperators]]
* [[StringSubstring]]
to:
* [[Reference/StringObject|String object]] – Your Reference for String objects
* [[CharacterAnalysis]] - We use the operators that allow us to recognise the type of character we are dealing with.
* [[StringAdditionOperator]] - Add strings together in a variety of ways.
* [[StringAppendOperator]] - Use the += operator and the concat() method to append things to Strings
* [[StringCaseChanges]] - Change the case of a string.
* [[StringComparisonOperators]] - Get/set the value of a specific character in a string.
* [[StringConstructors]] - Initialize string objects.
* [[StringIndexOf]] - Look for the first/last instance of a character in a string.
* [[StringLength]] - Get the length of a string.
* [[StringLengthTrim]] - Get and trim the length of a string.
* [[StringReplace]] - Replace individual characters in a string.
* [[StringStartsWithEndsWith]] - Check which characters/substrings a given string starts or ends with.
* [[StringSubstring]] - Look for "phrases" within a given string.
* [[StringToIntExample|StringToInt]] - Allows you to convert a String to an integer number.
August 11, 2015, at 10:52 AM by Simone Maiocchi -
Changed lines 39-40 from:
There is no circuit for this example, though your board must be connected to your computer via USB.
to:
There is no circuit for this example, though your board must be connected to your computer via USB and the serial monitor window of the Arduino Software (IDE) should be open.
Changed lines 68-69 from:

to:
\\
''Last revision 2015/08/11 by SM''
July 10, 2015, at 12:05 PM by Simone Maiocchi -
Changed lines 33-34 from:
!!!Hardware Required:
to:
!!!Hardware Required
July 10, 2015, at 12:04 PM by Simone Maiocchi -
Changed lines 1-7 from:
''Examples > Strings''

!!!String Character Functions

The [[Reference/StringObject|String]] functions @@charAt()@@ and @@setCharAt()@@ are used to get or set the value of a character at a given position in a String.

(:div class=BOM :)
to:
(:div class=breadcrumb:)
[[Tutorial.HomePage | Tutorials]] &gt; [[Tutorial.Examples | Examples]] &gt; Strings &gt; StringCharacters
Added lines 5-10:
(:*toc:)

!!String Character Functions

The [[Reference/StringObject|String]] functions @@charAt()@@ and @@setCharAt()@@ are used to get or set the value of a character at a given position in a String.
Changed lines 13-14 from:
(:div class=code :)
(:source lang=arduino tabwidth=4:)
to:
[@
Changed lines 17-19 from:
(:sourceend:)
(:divend:)
to:
@]
Changed lines 21-22 from:
(:div class=code :)
(:source lang=arduino tabwidth=4:)
to:
[@
Changed lines 27-29 from:
(:sourceend:)
(:divend:)
to:
@]
Changed lines 35-36 from:
* Arduino Board
to:
* Arduino or Genuino Board
Changed lines 39-40 from:
There is no circuit for this example, though your Arduino must be connected to your computer via USB.
to:
There is no circuit for this example, though your board must be connected to your computer via USB.
Changed lines 53-55 from:
!!!See Also:

to:
!!!See Also

March 13, 2015, at 03:40 PM by Arturo -
Changed line 52 from:
(:sourcehttps://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/08.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/08.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
March 13, 2015, at 03:39 PM by Arturo -
Changed line 52 from:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/08.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
to:
(:sourcehttps://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/08.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
May 02, 2012, at 03:56 PM by Scott Fitzgerald -
Changed line 52 from:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/08.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
November 16, 2011, at 04:25 AM by Scott Fitzgerald -
Changed line 52 from:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringCharacters/StringCharacters.pde lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringCharacters/StringCharacters.ino lang=arduino tabwidth=4:)
September 19, 2010, at 11:29 PM by Christian Cerrito -
Added lines 71-72:

September 19, 2010, at 11:29 PM by Christian Cerrito -
Added lines 57-58:

September 19, 2010, at 11:28 PM by Christian Cerrito -
Changed lines 34-35 from:
!!!Circuit
to:
September 19, 2010, at 11:28 PM by Christian Cerrito -
Deleted lines 7-8:
!!!Hardware Required
No external hardware is required.
Changed lines 37-47 from:
There is no circuit for this example.
to:
!!!Hardware Required:

* Arduino Board

!!!Circuit
(:div class=circuit :)
There is no circuit for this example, though your Arduino must be connected to your computer via USB.

%height=250px%[[Attach:Arduino_bb.png | Attach:Arduino_bb.png]]
[-image developed using [[http://www.fritzing.org |Fritzing]]. For more circuit examples, see the [[http://fritzing.org/projects/|Fritzing project page]] -]
September 16, 2010, at 10:39 PM by Tom Igoe -
Changed line 15 from:
[@
to:
(:source lang=arduino tabwidth=4:)
Changed line 19 from:
@]
to:
(:sourceend:)
Changed line 25 from:
[@
to:
(:source lang=arduino tabwidth=4:)
Changed line 31 from:
to:
(:source
August 01, 2010, at 05:15 PM by Tom Igoe -
Added lines 1-61:
''Examples > Strings''

!!!String Character Functions

The [[Reference/StringObject|String]] functions @@charAt()@@ and @@setCharAt()@@ are used to get or set the value of a character at a given position in a String.

(:div class=BOM :)
!!!Hardware Required
No external hardware is required.
(:divend:)

At their simplest, these functions help you search and replace a given character. For example, the following replaces the colon in a given String with an equals sign:

(:div class=code :)
[@
String reportString = "SensorReading: 456";
int colonPosition = reportString.indexOf(':');
reportString.setCharAt(colonPosition, '=');
@]
(:divend:)

Here's an example that checks to see if the first letter of the second word is 'B':

(:div class=code :)
[@
String reportString = "Franklin, Benjamin";
int spacePosition = reportString.indexOf(' ');
if (reportString.charAt(spacePosition + 1) == 'B') {
Serial.println("You might have found the Benjamins.")
}
@]
(:divend:)

'''Caution:'''
If you try to get the @@charAt@@ or try to @@setCharAt()@@ a value that's longer than the String's length, you'll get unexpected results. If you're not sure, check to see that the position you want to set or get is less than the string's length using the @@length()@@ function.
!!!Circuit

(:div class=circuit :)
There is no circuit for this example.
(:divend:)

!!!Code
(:div class=code :)

(:source

Share