Lines Matching defs:String

40  * The <code>String</code> class represents character strings. All
45 * are created. String buffers support mutable strings.
46 * Because String objects are immutable they can be shared. For example:
48 * String str = "abc";
53 * String str = new String(data);
58 * String cde = "cde";
60 * String c = "abc".substring(2,3);
61 * String d = cde.substring(1, 2);
64 * The class <code>String</code> includes methods for examining
73 * other objects to strings. String concatenation is implemented
76 * String conversions are implemented through the method
86 * <p>A <code>String</code> represents a string in the UTF-16 format
92 * character uses two positions in a <code>String</code>.
93 * <p>The <code>String</code> class provides methods for dealing with
108 public final class String
109 implements java.io.Serializable, Comparable<String>, CharSequence {
120 * Class String is special cased within the Serialization Stream Protocol.
122 * A String instance is written initially into an ObjectOutputStream in the
125 * <code>TC_STRING</code> (utf String)
127 * The String is written by method <code>DataOutput.writeUTF</code>.
135 * Initializes a newly created {@code String} object so that it represents
139 public String() {
144 * Initializes a newly created {@code String} object so that it represents
151 * A {@code String}
153 public String(String original) {
159 * Allocates a new {@code String} so that it represents the sequence of
167 public String(char value[]) {
172 * Allocates a new {@code String} that contains characters from a subarray
192 public String(char value[], int offset, int count) {
207 * Allocates a new {@code String} that contains characters from a subarray
234 public String(int[] codePoints, int offset, int count) {
274 * Allocates a new {@code String} constructed from a subarray of an array
286 * {@code String} constructors that take a {@link
304 * @see #String(byte[], int)
305 * @see #String(byte[], int, int, java.lang.String)
306 * @see #String(byte[], int, int, java.nio.charset.Charset)
307 * @see #String(byte[], int, int)
308 * @see #String(byte[], java.lang.String)
309 * @see #String(byte[], java.nio.charset.Charset)
310 * @see #String(byte[])
313 public String(byte ascii[], int hibyte, int offset, int count) {
331 * Allocates a new {@code String} containing characters constructed from
343 * {@code String} constructors that take a {@link
353 * @see #String(byte[], int, int, java.lang.String)
354 * @see #String(byte[], int, int, java.nio.charset.Charset)
355 * @see #String(byte[], int, int)
356 * @see #String(byte[], java.lang.String)
357 * @see #String(byte[], java.nio.charset.Charset)
358 * @see #String(byte[])
361 public String(byte ascii[], int hibyte) {
366 * and requested offset & length values used by the String(byte[],..)
379 * Constructs a new {@code String} by decoding the specified subarray of
380 * bytes using the specified charset. The length of the new {@code String}
411 public String(byte bytes[], int offset, int length, String charsetName)
420 * Constructs a new {@code String} by decoding the specified subarray of
422 * The length of the new {@code String} is a function of the charset, and
449 public String(byte bytes[], int offset, int length, Charset charset) {
457 * Constructs a new {@code String} by decoding the specified array of bytes
459 * length of the new {@code String} is a function of the charset, and hence
479 public String(byte bytes[], String charsetName)
485 * Constructs a new {@code String} by decoding the specified array of
487 * The length of the new {@code String} is a function of the charset, and
504 public String(byte bytes[], Charset charset) {
509 * Constructs a new {@code String} by decoding the specified subarray of
511 * {@code String} is a function of the charset, and hence may not be equal
534 public String(byte bytes[], int offset, int length) {
540 * Constructs a new {@code String} by decoding the specified array of bytes
542 * String} is a function of the charset, and hence may not be equal to the
555 public String(byte bytes[]) {
568 public String(StringBuffer buffer) {
589 public String(StringBuilder builder) {
597 * String(char[]) constructor that makes a copy of the given char[].
599 String(char[] value, boolean share) {
607 * @deprecated Use {@link #String(char[],int,int)} instead.
610 String(int offset, int count, char[] value) {
671 * than the length of this <code>String</code>, and the
724 * range of this <code>String</code>. The text range begins at the
739 * is larger than the length of this <code>String</code>, or
751 * Returns the index within this <code>String</code> that is
759 * @return the index within this <code>String</code>
762 * <code>String</code>, or if <code>codePointOffset</code> is positive
866 * <li> {@code srcEnd} is greater than the length of this String
894 * Encodes this {@code String} into a sequence of bytes using the named
913 public byte[] getBytes(String charsetName)
920 * Encodes this {@code String} into a sequence of bytes using the given
931 * the {@code String}
943 * Encodes this {@code String} into a sequence of bytes using the
962 * String} object that represents the same sequence of characters as this
966 * The object to compare this {@code String} against
968 * @return {@code true} if the given object represents a {@code String}
971 * @see #compareTo(String)
972 * @see #equalsIgnoreCase(String)
978 if (anObject instanceof String) {
979 String anotherString = (String) anObject;
998 * is {@code true} if and only if this {@code String} represents the same
1002 * The {@code StringBuffer} to compare this {@code String} against
1004 * @return {@code true} if this {@code String} represents the same
1018 * is {@code true} if and only if this {@code String} represents the same
1022 * The sequence to compare this {@code String} against
1024 * @return {@code true} if this {@code String} represents the same
1046 // Argument is a String
1062 * Compares this {@code String} to another {@code String}, ignoring case
1081 * The {@code String} to compare this {@code String} against
1084 * represents an equivalent {@code String} ignoring case; {@code
1089 public boolean equalsIgnoreCase(String anotherString) {
1100 * <code>String</code> object is compared lexicographically to the
1102 * a negative integer if this <code>String</code> object
1104 * positive integer if this <code>String</code> object lexicographically
1130 * @param anotherString the <code>String</code> to be compared.
1137 public int compareTo(String anotherString) {
1157 * A Comparator that orders <code>String</code> objects as by
1165 * @see java.text.Collator#compare(String, String)
1168 public static final Comparator<String> CASE_INSENSITIVE_ORDER
1171 implements Comparator<String>, java.io.Serializable {
1175 public int compare(String s1, String s2) {
1212 * @param str the <code>String</code> to be compared.
1214 * specified String is greater than, equal to, or less
1215 * than this String, ignoring case considerations.
1216 * @see java.text.Collator#compare(String, String)
1219 public int compareToIgnoreCase(String str) {
1226 * A substring of this <tt>String</tt> object is compared to a substring
1229 * <tt>String</tt> object to be compared begins at index <tt>toffset</tt>
1237 * <tt>String</tt> object.
1254 public boolean regionMatches(int toffset, String other, int ooffset,
1277 * A substring of this <tt>String</tt> object is compared to a substring
1281 * this <tt>String</tt> object to be compared begins at index
1289 * <tt>String</tt> object.
1325 String other, int ooffset, int len) {
1376 * <code>String</code> object; otherwise the result is the same
1382 public boolean startsWith(String prefix, int toffset) {
1409 * <code>String</code> object as determined by the
1413 public boolean startsWith(String prefix) {
1425 * empty string or is equal to this <code>String</code> object
1428 public boolean endsWith(String suffix) {
1434 * <code>String</code> object is computed as
1462 * this <code>String</code> object, then the index (in Unicode
1491 * character sequence represented by this <code>String</code>
1582 * <code>String</code> is searched backwards starting at the last
1677 public int indexOf(String str) {
1697 public int indexOf(String str, int fromIndex) {
1703 * Code shared by String and StringBuffer to do searches. The
1768 public int lastIndexOf(String str) {
1788 public int lastIndexOf(String str, int fromIndex) {
1794 * Code shared by String and StringBuffer to do searches. The
1867 * length of this <code>String</code> object.
1869 public String substring(int beginIndex) {
1877 return (beginIndex == 0) ? this : new String(value, beginIndex, subLen);
1898 * this <code>String</code> object, or
1902 public String substring(int beginIndex, int endIndex) {
1914 : new String(value, beginIndex, subLen);
1930 * This method is defined so that the <tt>String</tt> class can implement
1953 * <code>String</code> object is returned. Otherwise, a new
1954 * <code>String</code> object is created, representing a character
1956 * represented by this <code>String</code> object and the character
1964 * @param str the <code>String</code> that is concatenated to the end
1965 * of this <code>String</code>.
1969 public String concat(String str) {
1977 return new String(buf, true);
1985 * character sequence represented by this <code>String</code> object,
1986 * then a reference to this <code>String</code> object is returned.
1987 * Otherwise, a new <code>String</code> object is created that
1989 * represented by this <code>String</code> object, except that every
2009 public String replace(char oldChar, char newChar) {
2030 return new String(buf, true);
2045 * java.util.regex.Pattern#matches(String,CharSequence)
2062 public boolean matches(String regex) {
2108 * @return The resulting <tt>String</tt>
2118 public String replaceFirst(String regex, String replacement) {
2151 * @return The resulting <tt>String</tt>
2161 public String replaceAll(String regex, String replacement) {
2179 public String replace(CharSequence target, CharSequence replacement) {
2264 public String[] split(String regex, int limit) {
2266 (1)one-char String and this character is not one of the
2268 (2)two-char String and the first char is the backslash and
2285 ArrayList<String> list = new ArrayList<>();
2299 return new String[]{this};
2310 String[] result = new String[resultSize];
2321 * #split(String, int) split} method with the given expression and a limit
2354 public String[] split(String regex) {
2359 * Converts all of the characters in this <code>String</code> to lower
2363 * <code>String</code> may be a different length than the original <code>String</code>.
2389 * <td>lowercased all chars in String</td>
2399 * <td>lowercased all chars in String</td>
2404 * @return the <code>String</code>, converted to lowercase.
2405 * @see java.lang.String#toLowerCase()
2406 * @see java.lang.String#toUpperCase()
2407 * @see java.lang.String#toUpperCase(Locale)
2410 public String toLowerCase(Locale locale) {
2446 String lang = locale.getLanguage();
2501 return new String(result, 0, len + resultOffset);
2505 * Converts all of the characters in this <code>String</code> to lower
2520 * @return the <code>String</code>, converted to lowercase.
2521 * @see java.lang.String#toLowerCase(Locale)
2523 public String toLowerCase() {
2528 * Converts all of the characters in this <code>String</code> to upper
2532 * <code>String</code> may be a different length than the original <code>String</code>.
2569 * @return the <code>String</code>, converted to uppercase.
2570 * @see java.lang.String#toUpperCase()
2571 * @see java.lang.String#toLowerCase()
2572 * @see java.lang.String#toLowerCase(Locale)
2575 public String toUpperCase(Locale locale) {
2612 String lang = locale.getLanguage();
2664 return new String(result, 0, len + resultOffset);
2668 * Converts all of the characters in this <code>String</code> to upper
2683 * @return the <code>String</code>, converted to uppercase.
2684 * @see java.lang.String#toUpperCase(Locale)
2686 public String toUpperCase() {
2694 * If this <code>String</code> object represents an empty character
2696 * represented by this <code>String</code> object both have codes
2698 * reference to this <code>String</code> object is returned.
2702 * <code>String</code> object representing an empty string is created
2708 * is greater than <code>'&#92;u0020'</code>. A new <code>String</code>
2721 public String trim() {
2740 public String toString() {
2796 public static String format(String format, Object... args) {
2840 public static String format(Locale l, String format, Object... args) {
2853 public static String valueOf(Object obj) {
2867 public static String valueOf(char data[]) {
2868 return new String(data);
2883 * <code>String</code>.
2884 * @param count the length of the value of the <code>String</code>.
2892 public static String valueOf(char data[], int offset, int count) {
2893 return new String(data, offset, count);
2897 * Returns a String that represents the character sequence in the
2903 * @return a <code>String</code> that contains the characters of the
2906 public static String copyValueOf(char data[], int offset, int count) {
2907 // All public String constructors now copy the data.
2908 return new String(data, offset, count);
2912 * Returns a String that represents the character sequence in the
2916 * @return a <code>String</code> that contains the characters of the
2919 public static String copyValueOf(char data[]) {
2920 return new String(data);
2931 public static String valueOf(boolean b) {
2943 public static String valueOf(char c) {
2945 return new String(data, true);
2958 public static String valueOf(int i) {
2972 public static String valueOf(long l) {
2986 public static String valueOf(float f) {
3000 public static String valueOf(double d) {
3008 * class <code>String</code>.
3011 * string equal to this <code>String</code> object as determined by
3013 * returned. Otherwise, this <code>String</code> object is added to the
3014 * pool and a reference to this <code>String</code> object is returned.
3021 * interned. String literals are defined in section 3.10.5 of the
3027 public native String intern();
3038 System.identityHashCode(String.class),