-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathString_indexOf.xml
More file actions
executable file
·59 lines (42 loc) · 1.27 KB
/
String_indexOf.xml
File metadata and controls
executable file
·59 lines (42 loc) · 1.27 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>indexOf()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
String str = "CCCP";
int p1 = str.indexOf("C");
int p2 = str.indexOf("P");
int p3 = str.indexOf("CP");
println(p1 + ":" + p2 + ":" + p3); // Prints "0:3:2"
]]></code>
</example>
<description><![CDATA[
Tests to see if a substring is embedded in a String, and returns the index position of the first occurrence of the substring defined in the <b>str</b> parameter. If the <b>str</b> substring is not found within the String, <b>-1</b> is returned.
]]></description>
<syntax>
<c>str</c>.indexOf(<c>str</c>)
<c>str</c>.indexOf(<c>str</c>, <c>fromIndex</c>)
</syntax>
<parameter>
<label>str</label>
<description><![CDATA[String: any variable of type String]]></description>
</parameter>
<parameter>
<label>str</label>
<description><![CDATA[String: the substring to search]]></description>
</parameter>
<parameter>
<label>fromIndex</label>
<description><![CDATA[int: the index from which to start the search]]></description>
</parameter>
<returns>int</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>