Files
Dmitry Batrak 47d248a44b disable bullets in Javadoc inheritance list
list-style attribute used in standard javadoc's stylesheet seems to be
unsupported by JDK's HTML kit
(following IDEA-107790)
- fix tests
2017-10-16 12:33:59 +03:00

226 lines
11 KiB
HTML

<HTML><style type="text/css"> ul.inheritance {
margin:0;
padding:0;
}
ul.inheritance li {
display:inline;
list-style-type:none;
}
ul.inheritance li ul.inheritance {
margin-left:15px;
padding-left:15px;
padding-top:1px;
}
</style>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_27) on Wed Aug 10 15:58:01 PDT 2011 -->
<TITLE>
String (Java Platform SE 6)
</TITLE>
<META NAME="date" CONTENT="2011-08-10">
<META NAME="keywords" CONTENT="java.lang.String class">
<META NAME="keywords" CONTENT="CASE_INSENSITIVE_ORDER">
<META NAME="keywords" CONTENT="length()">
<META NAME="keywords" CONTENT="isEmpty()">
<META NAME="keywords" CONTENT="charAt()">
<META NAME="keywords" CONTENT="codePointAt()">
<META NAME="keywords" CONTENT="codePointBefore()">
<META NAME="keywords" CONTENT="codePointCount()">
<META NAME="keywords" CONTENT="offsetByCodePoints()">
<META NAME="keywords" CONTENT="getChars()">
<META NAME="keywords" CONTENT="getBytes()">
<META NAME="keywords" CONTENT="equals()">
<META NAME="keywords" CONTENT="contentEquals()">
<META NAME="keywords" CONTENT="equalsIgnoreCase()">
<META NAME="keywords" CONTENT="compareTo()">
<META NAME="keywords" CONTENT="compareToIgnoreCase()">
<META NAME="keywords" CONTENT="regionMatches()">
<META NAME="keywords" CONTENT="startsWith()">
<META NAME="keywords" CONTENT="endsWith()">
<META NAME="keywords" CONTENT="hashCode()">
<META NAME="keywords" CONTENT="indexOf()">
<META NAME="keywords" CONTENT="lastIndexOf()">
<META NAME="keywords" CONTENT="substring()">
<META NAME="keywords" CONTENT="subSequence()">
<META NAME="keywords" CONTENT="concat()">
<META NAME="keywords" CONTENT="replace()">
<META NAME="keywords" CONTENT="matches()">
<META NAME="keywords" CONTENT="contains()">
<META NAME="keywords" CONTENT="replaceFirst()">
<META NAME="keywords" CONTENT="replaceAll()">
<META NAME="keywords" CONTENT="split()">
<META NAME="keywords" CONTENT="toLowerCase()">
<META NAME="keywords" CONTENT="toUpperCase()">
<META NAME="keywords" CONTENT="trim()">
<META NAME="keywords" CONTENT="toString()">
<META NAME="keywords" CONTENT="toCharArray()">
<META NAME="keywords" CONTENT="format()">
<META NAME="keywords" CONTENT="valueOf()">
<META NAME="keywords" CONTENT="copyValueOf()">
<META NAME="keywords" CONTENT="intern()">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="String (Java Platform SE 6)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/String.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java&#x2122;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;6</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/lang/StrictMath.html" title="class in java.lang"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/lang/StringBuffer.html" title="class in java.lang"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?java/lang/String.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="String.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
<FONT SIZE="-1">
java.lang</FONT>
<BR>
Class String</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>java.lang.String</B>
</PRE>
<DL><DL>
<DT><BR><PRE>public final class <B>String</B><DT><BR>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A><DT><BR>implements <A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A>, <A HREF="../../java/lang/Comparable.html" title="interface in java.lang">Comparable</A>&lt;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&gt;, <A HREF="../../java/lang/CharSequence.html" title="interface in java.lang">CharSequence</A></DL>
</PRE>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A>, <A HREF="../../java/lang/CharSequence.html" title="interface in java.lang">CharSequence</A>, <A HREF="../../java/lang/Comparable.html" title="interface in java.lang">Comparable</A>&lt;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&gt;</DD>
</DL>
<P> The <code>String</code> class represents character strings. All
string literals in Java programs, such as <code>"abc"</code>, are
implemented as instances of this class.
<p>
Strings are constant; their values cannot be changed after they
are created. String buffers support mutable strings.
Because String objects are immutable they can be shared. For example:
<p><blockquote><pre>
String str = "abc";
</pre></blockquote><p>
is equivalent to:
<p><blockquote><pre>
char data[] = {'a', 'b', 'c'};
String str = new String(data);
</pre></blockquote><p>
Here are some more examples of how strings can be used:
<p><blockquote><pre>
System.out.println("abc");
String cde = "cde";
System.out.println("abc" + cde);
String c = "abc".substring(2,3);
String d = cde.substring(1, 2);
</pre></blockquote>
<p>
The class <code>String</code> includes methods for examining
individual characters of the sequence, for comparing strings, for
searching strings, for extracting substrings, and for creating a
copy of a string with all characters translated to uppercase or to
lowercase. Case mapping is based on the Unicode Standard version
specified by the <A HREF="../../java/lang/Character.html" title="class in java.lang"><CODE>Character</CODE></A> class.
<p>
The Java language provides special support for the string
concatenation operator (&nbsp;+&nbsp;), and for conversion of
other objects to strings. String concatenation is implemented
through the <code>StringBuilder</code>(or <code>StringBuffer</code>)
class and its <code>append</code> method.
String conversions are implemented through the method
<code>toString</code>, defined by <code>Object</code> and
inherited by all classes in Java. For additional information on
string concatenation and conversion, see Gosling, Joy, and Steele,
<i>The Java Language Specification</i>.
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
or method in this class will cause a <A HREF="../../java/lang/NullPointerException.html" title="class in java.lang"><CODE>NullPointerException</CODE></A> to be
thrown.
<p>A <code>String</code> represents a string in the UTF-16 format
in which <em>supplementary characters</em> are represented by <em>surrogate
pairs</em> (see the section <a href="Character.html#unicode">Unicode
Character Representations</a> in the <code>Character</code> class for
more information).
Index values refer to <code>char</code> code units, so a supplementary
character uses two positions in a <code>String</code>.
<p>The <code>String</code> class provides methods for dealing with
Unicode code points (i.e., characters), in addition to those for
dealing with Unicode code units (i.e., <code>char</code> values).
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>JDK1.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Object.html#toString()"><CODE>Object.toString()</CODE></A>,
<A HREF="../../java/lang/StringBuffer.html" title="class in java.lang"><CODE>StringBuffer</CODE></A>,
<A HREF="../../java/lang/StringBuilder.html" title="class in java.lang"><CODE>StringBuilder</CODE></A>,
<A HREF="../../java/nio/charset/Charset.html" title="class in java.nio.charset"><CODE>Charset</CODE></A>,
<A HREF="../../serialized-form.html#java.lang.String">Serialized Form</A></DL>
<P>
</HTML>