You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/api_en/include/String.xml
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -44,13 +44,13 @@ println(quoted); // This one has "quotes"
44
44
</example>
45
45
46
46
<description><![CDATA[
47
-
A string is a sequence of characters. The class <b>String</b> includes methods for examining individual characters, comparing strings, searching strings, extracting parts of strings, and for converting an entire string uppercase and lowercase. Strings are always defined inside double quotes ("Abc"), and characters are always defined inside single quotes ('A').<br/>
47
+
A string is a sequence of characters. The class <b>String</b> includes methods for examining individual characters, comparing strings, searching strings, extracting parts of strings, and for converting an entire string uppercase and lowercase. Strings are always defined inside double quotes (<b>"Abc"</b>), and characters are always defined inside single quotes (<b>'A'</b>).<br/>
48
48
<br/>
49
-
To compare the contents of two Strings, use the <b>equals()</b> method, as in "if (a.equals(b))", instead of "if (a == b)". A String is an Object, so comparing them with the == operator only compares whether both Strings are stored in the same memory location. Using the <b>equals()</b> method will ensure that the actual contents are compared. (The <a href="http://wiki.processing.org/w/Troubleshooting#Why_don.27t_these_Strings_equal.3F">troubleshooting</a> reference has a longer explanation.)<br />
49
+
To compare the contents of two Strings, use the <b>equals()</b> method, as in <b>if (a.equals(b))</b>, instead of <b>if (a == b)</b>. A String is an Object, so comparing them with the <b>==</b> operator only compares whether both Strings are stored in the same memory location. Using the <b>equals()</b> method will ensure that the actual contents are compared. (The <a href="http://wiki.processing.org/w/Troubleshooting#Why_don.27t_these_Strings_equal.3F">troubleshooting</a> reference has a longer explanation.)<br />
50
50
<br />
51
-
Because a String is defined between quotation marks, to include such marks within the String itself you must use the \ (backslash) character. (See the third example above.) This is known as an <em>escape sequence</em>. Other escape sequences include \t for the tab character and \n for new line. Because backslash is the escape character, to include a single backslash within a String, you must use two consecutive backslashes, as in: \\<br/>
51
+
Because a String is defined between double quotation marks, to include such marks within the String itself you must use the <b>\</b> (backslash) character. (See the third example above.) This is known as an <em>escape sequence</em>. Other escape sequences include <b>\t</b> for the tab character and <b>\n</b> for new line. Because backslash is the escape character, to include a single backslash within a String, you must use two consecutive backslashes, as in: <b>\\</b><br/>
52
52
<br/>
53
-
There are more string methods than those linked from this page. Additional documentation is located online in the <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html">official Java documentation.</a>.
53
+
There are more string methods than those linked from this page. Additional documentation is located online in the <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html">official Java documentation</a>.
54
54
]]></description>
55
55
56
56
<syntax></syntax>
@@ -67,7 +67,7 @@ There are more string methods than those linked from this page. Additional docum
67
67
68
68
<method>
69
69
<mname>indexOf()</mname>
70
-
<mdescription>Returns the index value of the first occurance of a character within the input string</mdescription>
70
+
<mdescription>Returns the index value of the first occurrence of a substring within the input string</mdescription>
Tests to see if a substring is embedded in a string and returns the index position of the first occurance of the substring defined in the <b>str</b> parameter. If the <b>str</b> parameter is not found in the string, -1 is returned.
24
+
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.
0 commit comments