forked from processing-js/processing-js.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString_substring_.html
More file actions
68 lines (60 loc) · 1.67 KB
/
Copy pathString_substring_.html
File metadata and controls
68 lines (60 loc) · 1.67 KB
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
63
64
65
66
67
68
---
layout: default
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr>
<th scope="row">Class</th>
<td>String</td>
</tr>
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>substring()</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><pre>String str1 = "CCCP";
String str2 = "Rabbit";
String ss1 = str1.substring(2); // Returns "CP"
String ss2 = str2.substring(3); // Returns "bit"
String ss3 = str1.substring(0, 2); // Returns "CC"
println(ss1 + ":" + ss2 + ":" + ss3); // Prints 'CP:bit:CC'</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td>Returns a new string that is a part of the original string. When using the <b>endIndex</b> parameter, the string between <b>beginIndex</b> and <b>endIndex</b>-1 is returned.
</td>
</tr>
<tr class="">
<th scope="row">Syntax</th>
<td><pre><kbd>str</kbd>.indexOf(<kbd>beginIndex</kbd>)</pre><br />
<pre><kbd>str</kbd>.indexOf(<kbd>beginIndex</kbd>,<kbd>endIndex</kbd>)</pre>
</td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">str</th>
<td>String: any variable of type String</td>
</tr>
<tr class="">
<th scope="row">beginIndex</th>
<td>int: position from which to begin (inclusive)</td>
</tr>
<tr class="">
<th scope="row">endIndex</th>
<td>int: position from which to end (exclusive)</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row">Returns</th>
<td>String</td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
</table>