StringDataCompositeWeb & Application
String str1 = "CCCP";
char data[] = {'C', 'C', 'C', 'P'};
String str2 = new String(data);
println(str1); // Prints "CCCP" to the console
println(str2); // Prints "CCCP" to the console
A string is a sequence of characters. The class String 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').
There are more string methods than those linked from this page. Additional String documentation is located at http://java.sun.com/j2se/1.4.2/docs/api/
charAt()Returns the character at the specified indexequals()Compares a string to a specified objectindexOf()Returns the index value of the first occurance of a character within the input stringlength()Returns the number of characters in the input stringsubstring()Returns a new string that is part of the input stringtoLowerCase()Converts all the characters to lower casetoUpperCase()Converts all the characters to upper case
String(data)
String(data, offset, length)
databyte[] or char[]: array of bytes to be decoded into characters or array of characters to be combined into a stringoffsetint: index of the first characterlengthint: number of characters
char
text()
1.0ObjectPDE