mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 01:50:44 +01:00
52 lines
996 B
XML
52 lines
996 B
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
|
|
<name>equals()</name>
|
|
|
|
<category>String</category>
|
|
|
|
<subcategory>Method</subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image></image>
|
|
<code>
|
|
String str1 = "CCCP";
|
|
String str2 = "CCCP";
|
|
// Tests to see if str1 is equal to str2
|
|
if(str1.equals(str2) == true) {
|
|
println("Equal"); // They are equal so this line will print
|
|
} else {
|
|
println("Not equal");
|
|
}
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Compares two strings to see if they are the same. This method is necessary because it's not possible to compare strings using the equality operator (==). Returns <b>true</b> if the strings are the same and <b>false</b> if they are not.
|
|
</description>
|
|
|
|
<syntax>
|
|
equals(<c>str</c>)
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>str</label>
|
|
<description>String: any valid String</description>
|
|
</parameter>
|
|
|
|
<returns>Boolean</returns>
|
|
|
|
<related>
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Method</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
|
|
</root>
|