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/hex.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ println(hex(c, 6)); // Prints "FFCC00"
32
32
<description><![CDATA[
33
33
Converts a byte, char, int, or color to a String containing the equivalent hexadecimal notation. For example color(0, 102, 153) will convert to the String "FF006699". This function can help make your geeky debugging sessions much happier.
34
34
<br/> <br/>
35
-
Note that the maximum number of digits is 8, because an int value can only represent up to 32 bits. Specifying more than eight digits will simply shorten the string to eight anyway.
35
+
Note that the maximum number of digits is 8, because an int value can only represent up to 32 bits. Specifying more than eight digits will not increase the length of the string further.
Copy file name to clipboardExpand all lines: content/api_en/include/String.xml
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -38,18 +38,18 @@ if (p.equals("potato")) {
38
38
<image></image>
39
39
<code><![CDATA[
40
40
// Use a backslash to include quotes in a String
41
-
String quoted = "This one has \\"quotes\\"";
41
+
String quoted = "This one has \"quotes\"";
42
42
println(quoted); // This one has "quotes"
43
43
]]></code>
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').
48
-
<br /> <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 ("Abc"), and characters are always defined inside single quotes('A').<br/>
48
+
<br/>
49
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 />
50
50
<br />
51
-
Because a String is defined within quotes, including quotes in a String requires the \\ (backslash) character to be used (see the second 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. A single backslash is indicated by \\.<br />
52
-
<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/>
52
+
<br/>
53
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>.
<cdescription>byte[] or char[]: array of bytes to be decoded into characters or array of characters to be combined into a string</cdescription>
100
+
<cdescription>byte[] or char[]: either an array of bytes to be decoded into characters, or an array of characters to be combined into a string</cdescription>
0 commit comments