| 1 | <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 | <title>Formulas 1.3. String expressions</title> |
| 3 | <style> |
| 4 | td { padding-left: 5pt; padding-right: 5pt; } |
| 5 | th { padding-left: 5pt; padding-right: 5pt; } |
| 6 | code { white-space: pre-wrap; } |
| 7 | dd { white-space: pre-wrap; } |
| 8 | </style> |
| 9 | </head><body bgcolor="#FFFFFF"> |
| 10 | |
| 11 | <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 | Formulas 1.3. String expressions |
| 13 | </b></font></table></table> |
| 14 | <p>All the formulas whose outcome is a text are called string expressions. A <i>string</i> is programming jargon for a text; think of a text as a “string” of characters (letters).</p> |
| 15 | <p>Again, the outcomes of the following examples can be checked with the <a href="Calculator.html">calculator</a>.</p> |
| 16 | <dl> |
| 17 | <dt><b>"see" + "king"</b> |
| 18 | <dd>concatenates two strings. Outcome: seeking.</dd> |
| 19 | <dt><b>left$ ("internationalization", 6)</b> |
| 20 | <dd>computes the leftmost six letters of the string; the dollar sign is used for all functions whose result is a string. Outcome: intern.</dd> |
| 21 | <dt><b>mid$ ("internationalization", 6, 8)</b> |
| 22 | <dd>computes the 8-letter substring that starts at the sixth letter of "internationalization". Outcome: national.</dd> |
| 23 | <dt><b>date$ ( )</b> |
| 24 | <dd>computes the current date and time. Outcome at the time I am writing this: Mon Dec 2 02:23:45 2002.</dd> |
| 25 | </dl> |
| 26 | <h3>Links to this page</h3> |
| 27 | <ul> |
| 28 | <li><a href="Formulas.html">Formulas</a> |
| 29 | <li><a href="Formulas_1__My_first_formulas.html">Formulas 1. My first formulas</a> |
| 30 | </ul> |
| 31 | <hr> |
| 32 | <address> |
| 33 | <p>© ppgb 20170916</p> |
| 34 | </address> |
| 35 | </body> |
| 36 | </html> |