-
Notifications
You must be signed in to change notification settings - Fork 0
/
String.html
62 lines (62 loc) · 14 KB
/
String.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en"><!-- use theme color or fallback -->
<!--use textcolor from settings, otherwise create a contrasting color to theme color-->
<head><meta charset="utf-8"/><link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet"/><link href="./bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/><link href="./bootstrap/css/bootstrap-select.min.css" rel="stylesheet"/><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600,600italic,400" rel="stylesheet" type="text/css"/><link href="https://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet" type="text/css"/><script src="./jquery-1.9.1.min.js"></script><script src="./bootstrap/js/bootstrap.min.js"></script><script src="./bootstrap/js/bootstrap-select.min.js"></script><link href="./styles.css" rel="stylesheet"/><link href="./extra-styles.css" rel="stylesheet"/><link href="./haxe-nav.css" rel="stylesheet"/><script>var dox = {rootPath: "./",platforms: ["api"]};</script><script src="./nav.js"></script><script src="./index.js"></script><link rel="icon" href="./favicon.ico" type="image/x-icon"/><title>String</title><meta name="description" content="The basic String class."/></head><body><style>
.navbar .brand {
display: inline-block;
float: none;
text-shadow: 0 0 0 transparent;
</style><nav class="nav"><div class="navbar"><div class="navbar-inner" style="background:#FAFAFA; border-bottom:1px solid rgba(0,0,0,.09)"><div class="container"><a class="brand" style="color:#000000" href="./">API Documentation</a></div></div></div></nav><div class="container main-content"><div class="row-fluid"><div class="span3"><div class="well sidebar-nav"><form class="form-search" id="searchForm"><div class="input-prepend input-block-level"><span class="add-on"><i class="icon-search"></i></span><input id="search" type="text" placeholder="Filter (Ctrl+P)" autocomplete="off"/></div></form></div><div class="well sidebar-nav" id="explorer"><div id="nav"></div></div></div><div class="span9"><div class="page-header"><h1><small>class</small> String</h1><h4><small><a href="./">no package</a></small></h4> <span class="label label-meta label-meta-directlyUsed" title="Marks types that are directly referenced by non-extern code.">@:directlyUsed</span><span class="label label-meta label-meta-coreApi" title="Identifies this class as a core API class (forces API check).">@:coreApi</span></div><div class="body"><div class="doc doc-main"><p>The basic String class.</p>
<p>A Haxe String is immutable, it is not possible to modify individual
characters. No method of this class changes the state of <code>this</code> String.</p>
<p>Strings can be constructed using the String literal syntax <code>"string value"</code>.</p>
<p>String can be concatenated by using the <code>+</code> operator. If an operand is not a
String, it is passed through <code><a href="./Std.html#string">Std.string</a>()</code> first.</p><p class="javadoc">See also:</p><ul><li><div class="inline-content"><p><a href="https://haxe.org/manual/std-String.html">https://haxe.org/manual/std-String.html</a></p></div></li></ul></div><h3 class="section">Static methods</h3><div class="fields"><div class="field "><a name="fromCharCode"></a><h3 class="anchor"><code><span class="label label-meta label-meta-has_untyped" title="Used by the typer to mark fields that have untyped expressions.">@:has_untyped</span><span class="label label-static">static</span><span class="label label-inline">inline</span><a href="#fromCharCode"><span class="identifier">fromCharCode</span></a>(<span style="white-space:nowrap">code:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns the String corresponding to the character code <code>code</code>.</p>
<p>If <code>code</code> is negative or has another invalid value, the result is
unspecified.</p></div></div></div><h3 class="section">Constructor</h3><div class="fields"><div class="field "><a name="new"></a><h3 class="anchor"><code><a href="#new"><span class="identifier">new</span></a>(<span style="white-space:nowrap">string:<a class="type" title="String - The basic String class." href="./String.html">String</a></span>)</code></h3><div class="doc"><p>Creates a copy from a given String.</p></div></div></div><h3 class="section">Variables</h3><div class="fields"><div class="field "><a name="length"></a><h3 class="anchor"><code><span class="label">read only</span><a href="#length"><span class="identifier">length</span></a>:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>The number of characters in <code>this</code> String.</p></div></div></div><h3 class="section">Methods</h3><div class="fields"><div class="field "><a name="charAt"></a><h3 class="anchor"><code><a href="#charAt"><span class="identifier">charAt</span></a>(<span style="white-space:nowrap">index:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns the character at position <code>index</code> of <code>this</code> String.</p>
<p>If <code>index</code> is negative or exceeds <code>this.<a href="#length">length</a></code>, the empty String <code>""</code>
is returned.</p></div></div><div class="field "><a name="charCodeAt"></a><h3 class="anchor"><code><span class="label label-inline">inline</span><a href="#charCodeAt"><span class="identifier">charCodeAt</span></a>(<span style="white-space:nowrap">index:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="Null - Null&lt;T&gt; is a wrapper that can be used to make the basic types Int, Float and Bool nullable on static targets." href="./Null.html">Null</a><<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a>></code></h3><div class="doc"><p>Returns the character code at position <code>index</code> of <code>this</code> String.</p>
<p>If <code>index</code> is negative or exceeds <code>this.<a href="#length">length</a></code>, <code>null</code> is returned.</p>
<p>To obtain the character code of a single character, <code>"x".code</code> can be
used instead to inline the character code at compile time. Note that
this only works on String literals of length 1.</p></div></div><div class="field "><a name="indexOf"></a><h3 class="anchor"><code><a href="#indexOf"><span class="identifier">indexOf</span></a>(<span style="white-space:nowrap">str:<a class="type" title="String - The basic String class." href="./String.html">String</a>,</span> <span style="white-space:nowrap">?startIndex:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the position of the leftmost occurrence of <code>str</code> within <code>this</code>
String.</p>
<p>If <code>startIndex</code> is given, the search is performed within the substring
of <code>this</code> String starting from <code>startIndex</code> (if <code>startIndex</code> is posivite
or 0) or <code>max(this.<a href="#length">length</a> + startIndex, 0)</code> (if <code>startIndex</code> is negative).</p>
<p>If <code>startIndex</code> exceeds <code>this.<a href="#length">length</a></code>, -1 is returned.</p>
<p>Otherwise the search is performed within <code>this</code> String. In either case,
the returned position is relative to the beginning of <code>this</code> String.</p>
<p>If <code>str</code> cannot be found, -1 is returned.</p></div></div><div class="field "><a name="lastIndexOf"></a><h3 class="anchor"><code><a href="#lastIndexOf"><span class="identifier">lastIndexOf</span></a>(<span style="white-space:nowrap">str:<a class="type" title="String - The basic String class." href="./String.html">String</a>,</span> <span style="white-space:nowrap">?startIndex:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></code></h3><div class="doc"><p>Returns the position of the rightmost occurrence of <code>str</code> within <code>this</code>
String.</p>
<p>If <code>startIndex</code> is given, the search is performed within the substring
of <code>this</code> String from 0 to <code>startIndex + str.length</code>. Otherwise the search
is performed within <code>this</code> String. In either case, the returned position
is relative to the beginning of <code>this</code> String.</p>
<p>If <code>str</code> cannot be found, -1 is returned.</p></div></div><div class="field "><a name="split"></a><h3 class="anchor"><code><a href="#split"><span class="identifier">split</span></a>(<span style="white-space:nowrap">delimiter:<a class="type" title="String - The basic String class." href="./String.html">String</a></span>):<a class="type" title="Array - An Array is a storage for values." href="./Array.html">Array</a><<a class="type" title="String - The basic String class." href="./String.html">String</a>></code></h3><div class="doc"><p>Splits <code>this</code> String at each occurrence of <code>delimiter</code>.</p>
<p>If <code>this</code> String is the empty String <code>""</code>, the result is not consistent
across targets and may either be <code>[]</code> (on Js, Cpp) or <code>[""]</code>.</p>
<p>If <code>delimiter</code> is the empty String <code>""</code>, <code>this</code> String is split into an
Array of <code>this.<a href="#length">length</a></code> elements, where the elements correspond to the
characters of <code>this</code> String.</p>
<p>If <code>delimiter</code> is not found within <code>this</code> String, the result is an Array
with one element, which equals <code>this</code> String.</p>
<p>If <code>delimiter</code> is null, the result is unspecified.</p>
<p>Otherwise, <code>this</code> String is split into parts at each occurrence of
<code>delimiter</code>. If <code>this</code> String starts (or ends) with <code>delimiter</code>, the
result <code><a href="./Array.html">Array</a></code> contains a leading (or trailing) empty String <code>""</code> element.
Two subsequent delimiters also result in an empty String <code>""</code> element.</p></div></div><div class="field "><a name="substr"></a><h3 class="anchor"><code><span class="label label-inline">inline</span><a href="#substr"><span class="identifier">substr</span></a>(<span style="white-space:nowrap">pos:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">?len:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns <code>len</code> characters of <code>this</code> String, starting at position <code>pos</code>.</p>
<p>If <code>len</code> is omitted, all characters from position <code>pos</code> to the end of
<code>this</code> String are included.</p>
<p>If <code>pos</code> is negative, its value is calculated from the end of <code>this</code>
String by <code>this.<a href="#length">length</a> + pos</code>. If this yields a negative value, 0 is
used instead.</p>
<p>If the calculated position + <code>len</code> exceeds <code>this.<a href="#length">length</a></code>, the characters
from that position to the end of <code>this</code> String are returned.</p>
<p>If <code>len</code> is negative, the result is unspecified.</p></div></div><div class="field "><a name="substring"></a><h3 class="anchor"><code><a href="#substring"><span class="identifier">substring</span></a>(<span style="white-space:nowrap">startIndex:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a>,</span> <span style="white-space:nowrap">?endIndex:<a class="type" title="Int - The standard Int type." href="./Int.html">Int</a></span>):<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns the part of <code>this</code> String from <code>startIndex</code> to but not including <code>endIndex</code>.</p>
<p>If <code>startIndex</code> or <code>endIndex</code> are negative, 0 is used instead.</p>
<p>If <code>startIndex</code> exceeds <code>endIndex</code>, they are swapped.</p>
<p>If the (possibly swapped) <code>endIndex</code> is omitted or exceeds
<code>this.<a href="#length">length</a></code>, <code>this.<a href="#length">length</a></code> is used instead.</p>
<p>If the (possibly swapped) <code>startIndex</code> exceeds <code>this.<a href="#length">length</a></code>, the empty
String <code>""</code> is returned.</p></div></div><div class="field "><a name="toLowerCase"></a><h3 class="anchor"><code><a href="#toLowerCase"><span class="identifier">toLowerCase</span></a>():<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns a String where all characters of <code>this</code> String are lower case.</p></div></div><div class="field "><a name="toString"></a><h3 class="anchor"><code><a href="#toString"><span class="identifier">toString</span></a>():<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns the String itself.</p></div></div><div class="field "><a name="toUpperCase"></a><h3 class="anchor"><code><a href="#toUpperCase"><span class="identifier">toUpperCase</span></a>():<a class="type" title="String - The basic String class." href="./String.html">String</a></code></h3><div class="doc"><p>Returns a String where all characters of <code>this</code> String are upper case.</p></div></div></div></div></div></div></div><footer class="section site-footer" style="background:#FAFAFA"><div class="container"><div class="copyright"><p style="color:#000000">© 2020 </p></div></div></footer><script src=".//highlighter.js"></script><link href="./highlighter.css" rel="stylesheet"/></body></html>