mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 18:10:43 +01:00
49 lines
900 B
XML
49 lines
900 B
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
|
|
<name>charAt()</name>
|
|
|
|
<category>String</category>
|
|
|
|
<subcategory>Method</subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image></image>
|
|
<code>
|
|
String str = "CCCP";
|
|
char c1 = str.charAt(0);
|
|
char c2 = str.charAt(1);
|
|
char c3 = str.charAt(str.length()-1);
|
|
println(c1 + ":" + c2 + ":" + c3); // Prints 'C:C:P'
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Returns the character at the specified index. An index ranges from 0 to the length of the string minus 1. The first character of the sequence is at index 0, the next at index 1, etc.
|
|
</description>
|
|
|
|
<syntax>
|
|
charAt(<c>index</c>)
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>index</label>
|
|
<description>int: the index of the character</description>
|
|
</parameter>
|
|
|
|
<returns>char</returns>
|
|
|
|
<related>
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Method</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
|
|
</root>
|