Tutorial.StringLengthTrim History

Hide minor edits - Show changes to output

May 02, 2012, at 03:57 PM by Scott Fitzgerald -
Changed lines 21-22 from:
(:div class=code :)
to:

Changed line 27 from:
to:
(:div class=code :)
Deleted line 53:
May 02, 2012, at 03:55 PM by Scott Fitzgerald -
Changed line 28 from:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLength/StringLength.ino lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/08.Strings/StringLength/StringLength.ino lang=arduino tabwidth=4:)
May 02, 2012, at 03:55 PM by Scott Fitzgerald -
Changed line 35 from:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.ino lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino lang=arduino tabwidth=4:)
November 16, 2011, at 04:24 AM by Scott Fitzgerald -
Changed line 28 from:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLength/StringLength.pde lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLength/StringLength.ino lang=arduino tabwidth=4:)
Changed line 35 from:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.pde lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.ino lang=arduino tabwidth=4:)
September 19, 2010, at 11:47 PM by Christian Cerrito -
Added line 40:
Added lines 53-54:

September 19, 2010, at 11:47 PM by Christian Cerrito -
Added lines 21-24:
(:div class=code :)

!!!Code
Changed line 27 from:
(:div class=code :)
to:
September 19, 2010, at 11:46 PM by Christian Cerrito -
Changed line 9 from:
No external hardware is required.
to:
* Arduino Board
Changed lines 12-20 from:
to:
!!!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]] -]

(:divend:)
Changed lines 23-24 from:

(:div class=code :)
to:
(:div class=code :)
September 17, 2010, at 11:05 PM by Tom Igoe -
Changed line 24 from:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.pde lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.pde lang=arduino tabwidth=4:)
August 15, 2010, at 03:27 PM by Tom Igoe -
Changed lines 20-21 from:
@@trim() is useful for when you know there are extraneous whitespace characters on the beginning or the end of a String and you want to get rid of them. ''Whitespace'' refers to characters that take space but aren't seen. It includes the single space (ASCII 32), tab (ASCII 9), vertical tab (ASCII 11), form feed (ASCII 12), carriage return (ASCII 13), or newline (ASCII 10). The example below shows a String with whitespace, before and after trimming:
to:
@@trim()@@ is useful for when you know there are extraneous whitespace characters on the beginning or the end of a String and you want to get rid of them. ''Whitespace'' refers to characters that take space but aren't seen. It includes the single space (ASCII 32), tab (ASCII 9), vertical tab (ASCII 11), form feed (ASCII 12), carriage return (ASCII 13), or newline (ASCII 10). The example below shows a String with whitespace, before and after trimming:
August 01, 2010, at 04:12 PM by Tom Igoe -
Deleted line 16:
[@
Deleted line 17:
@]
August 01, 2010, at 04:09 PM by Tom Igoe -
Added lines 1-42:
''Examples > Strings''

!!!String length() and trim() Commands

You can get the length of a [[Reference/StringObject|Strings]] using the @@length()@@ command, or eliminate extra characters using the trim() command. This example shows you how to use both commands.

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


@@length()@@ returns the length of a String. There are many occasions when you need this. For example,if you wanted to make sure a String was less than 140 characters, to fit it in a text message, you could do this:


(:div class=code :)
[@
(:source http://arduino.cc/en/pub/code/master/build/shared/examples/8.Strings/StringLength/StringLength.pde lang=arduino tabwidth=4:)
@]
(:divend:)

@@trim() is useful for when you know there are extraneous whitespace characters on the beginning or the end of a String and you want to get rid of them. ''Whitespace'' refers to characters that take space but aren't seen. It includes the single space (ASCII 32), tab (ASCII 9), vertical tab (ASCII 11), form feed (ASCII 12), carriage return (ASCII 13), or newline (ASCII 10). The example below shows a String with whitespace, before and after trimming:

(:div class=code :)

(:source

Share