Tutorial.StringLengthTrim History

Hide minor edits - Show changes to output

August 27, 2015, at 01:16 PM by Simone Maiocchi -
Changed lines 58-59 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:26 PM by Simone Maiocchi -
August 27, 2015, at 12:26 PM by Simone Maiocchi -
Changed line 45 from:
* [[Reference/StringObject|String object]]
to:
* [[Reference/StringObject|String object]] – Your Reference for String objects
August 27, 2015, at 12:17 PM by Simone Maiocchi -
Changed line 56 from:
* [[StringStartWithEndsWith]] - Check which characters/substrings a given string starts or ends with.
to:
* [[StringStartsWithEndsWith]] - Check which characters/substrings a given string starts or ends with.
August 27, 2015, at 12:02 PM by Simone Maiocchi -
Changed lines 58-59 from:
* [[StringToInt]] - Allows you to convert a String to an integer number.
to:
* [[StringToIntExample|StringToInt]] - Allows you to convert a String to an integer number.
August 27, 2015, at 11:46 AM by Simone Maiocchi -
Changed line 47 from:
* [[StringAdditionOperator]] - Add strings together in a variety of ways.
to:
* [[StringAdditionOperator]] - Add strings together in a variety of ways.
August 27, 2015, at 11:43 AM by Simone Maiocchi -
Changed lines 12-13 from:
to:
(:htmlend:)
August 27, 2015, at 11:42 AM by Simone Maiocchi -
Deleted lines 34-39:
@@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 https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/08.Strings/StringLength/StringLength.ino lang=arduino tabwidth=4:)
(:divend:)
Changed lines 53-54 from:
* [[StringLength]] - Get and trim the length of a string.
* [[StringLengthTrim]] - Get and trim the length of a string.
to:
* [[StringLength]] - Get the length of a string.
August 27, 2015, at 11:36 AM by Simone Maiocchi -
Changed lines 1-6 from:
(:div class=breadcrumb:)
[[Tutorial.HomePage | Tutorials]] > [[Tutorial.Examples | Examples]] > Strings > StringLengthTrim
(: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 > StringLenghtTrim
</p>
</div>
</div>
Deleted line 49:
Changed lines 51-62 from:
* [[StringConstructors]]
* [[StringAdditionOperator]]
* [[StringIndexOf]]
* [[StringAppendOperator]]
* [[StringLengthTrim]]
* [[StringCaseChanges]]
* [[StringReplace]]
* [[StringCharacters]]
* [[StringStartsWithEndsWith]]
* [[StringComparisonOperators]]
* [[StringSubstring]]
to:
* [[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.
* [[StringCharacters]] - Get/set the value of a specific character in 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 and trim the length of a string.
* [[StringLengthTrim]] - Get and trim the length of a string.
* [[StringReplace]] - Replace individual characters in a string.
* [[StringStartWithEndsWith]] - Check which characters/substrings a given string starts or ends with.
* [[StringSubstring]] - Look for "phrases" within a given string.
* [[StringToInt]] - Allows you to convert a String to an integer number.
August 11, 2015, at 11:05 AM by Simone Maiocchi -
Changed lines 18-19 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 and the serial monitor window of the Arduino Software (IDE) should be open.
Added lines 58-59:
\\
''Last revision 2015/08/11 by SM''
July 10, 2015, at 01:43 PM by Simone Maiocchi -
Changed lines 1-9 from:
''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
* Arduino Board
to:
(:div class=breadcrumb:)
[[Tutorial.HomePage | Tutorials]] &gt; [[Tutorial.Examples | Examples]] &gt; Strings &gt; StringLengthTrim
Added lines 5-15:
(:*toc:)

!!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
* Arduino or Genuino Board
(:divend:)
Changed lines 43-44 from:
!!!See Also:
to:
!!!See Also
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 https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringLength/StringLength.ino lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/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 https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.ino lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/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 https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringLength/StringLength.pde lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringLength/StringLength.ino lang=arduino tabwidth=4:)
Changed line 35 from:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.pde lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/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 https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples/8.Strings/StringLengthTrim/StringLengthTrim.pde lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/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 https://raw.githubusercontent.com/arduino/Arduino/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