| 1 | <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 | <title>index_caseInsensitive</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="Monaco,Courier" size=6 color="#999900"><b> |
| 12 | index_caseInsensitive |
| 13 | </b></font></table></table> |
| 14 | <p>A function that can be used in <a href="Formulas.html">Formulas</a>.</p> |
| 15 | <h2>Syntax and semantics</h2> |
| 16 | <dl> |
| 17 | <dt><b><code><font size=+1>index_caseInsensitive</font></code></b> (<i><code><font size=+1>string$</font></code></i>, <i><code><font size=+1>part$</font></code></i>) |
| 18 | <dd>return the first location of the substring <i><code><font size=+1>part$</font></code></i> inside <i><code><font size=+1>string$</font></code></i>, or 0 if not found.</dd> |
| 19 | <dt><b><code><font size=+1>index_caseInsensitive</font></code></b> (<i><code><font size=+1>strings$#</font></code></i>, <i><code><font size=+1>s$</font></code></i>) |
| 20 | <dd>look up whether and where <i><code><font size=+1>s$</font></code></i> first occurs in <i><code><font size=+1>strings$#</font></code></i>.</dd> |
| 21 | </dl> |
| 22 | <h2>Case insensitivity</h2> |
| 23 | <p>For determining where the substring is located, it doesn’t matter whether <i><code><font size=+1>string$</font></code></i> and/or <i><code><font size=+1>part$</font></code></i> are in lower case or upper case. Here is a comparison with <a href="_index_.html"><b><code><font size=+1>index</font></code></b></a>:</p> |
| 24 | <code> assert <a href="_index_.html">index</a> ("hello", "L") = 0<br></code> |
| 25 | <code> assert <b>index_caseInsensitive</b> ("hello", "L") = 3<br></code> |
| 26 | <code> assert <a href="_index_.html">index</a> ("heLlo", "L") = 3<br></code> |
| 27 | <code> assert <b>index_caseInsensitive</b> ("heLlo", "L") = 3<br></code> |
| 28 | <code> assert <a href="_index_.html">index</a> ("helLo", "L") = 4<br></code> |
| 29 | <code> assert <b>index_caseInsensitive</b> ("helLo", "L") = 3<br></code> |
| 30 | <code> assert <a href="_index_.html">index</a> ("heLLo", "L") = 3<br></code> |
| 31 | <code> assert <b>index_caseInsensitive</b> ("heLLo", "L") = 3<br></code> |
| 32 | <h2>See also</h2> |
| 33 | <dl> |
| 34 | <dd style="position:relative;padding-left:1em;text-indent:-2em">• <a href="_rindex_caseInsensitive_.html"><b><code><font size=+1>rindex_caseInsensitive</font></code></b></a> for the <i>last</i> occurrence</dd> |
| 35 | <dd style="position:relative;padding-left:1em;text-indent:-2em">• <a href="_index_.html"><b><code><font size=+1>index</font></code></b></a> for <i>case-sensitive</i> matching</dd> |
| 36 | </dl> |
| 37 | <h3>Links to this page</h3> |
| 38 | <ul> |
| 39 | <li><a href="Functions.html">Functions</a> |
| 40 | <li><a href="What_was_new_in_6_4_.html">What was new in 6.4?</a> |
| 41 | </ul> |
| 42 | <hr> |
| 43 | <address> |
| 44 | <p>© Paul Boersma 2023</p> |
| 45 | </address> |
| 46 | </body> |
| 47 | </html> |