public final class String extends Object implements CharSequence, Comparable<String>
| Modifier and Type | Field and Description |
|---|---|
static Comparator<String> |
CASE_INSENSITIVE_ORDER |
| Constructor and Description |
|---|
String() |
String(byte[] bytes) |
String(byte[] bytes,
Charset charset) |
String(byte[] bytes,
int off,
int len) |
String(byte[] bytes,
int off,
int len,
String enc) |
String(byte[] bytes,
String enc) |
String(char[] value) |
String(char[] value,
int offset,
int count) |
String(String value) |
String(StringBuffer buffer) |
String(StringBuilder buffer) |
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
int |
compareTo(String anotherString) |
int |
compareToIgnoreCase(String anotherString) |
String |
concat(String str) |
boolean |
contains(CharSequence seq) |
boolean |
contentEquals(CharSequence cs) |
boolean |
contentEquals(StringBuffer sb) |
static String |
copyValueOf(char[] data) |
static String |
copyValueOf(char[] data,
int offset,
int count) |
boolean |
endsWith(String suffix) |
boolean |
equals(Object anObject) |
boolean |
equalsIgnoreCase(String anotherString) |
static String |
format(String format,
Object... args) |
byte[] |
getBytes() |
byte[] |
getBytes(Charset charset) |
byte[] |
getBytes(String enc) |
void |
getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin) |
int |
hashCode() |
int |
indexOf(int ch) |
int |
indexOf(int ch,
int fromIndex) |
int |
indexOf(String str) |
int |
indexOf(String str,
int fromIndex) |
String |
intern() |
boolean |
isEmpty() |
int |
lastIndexOf(int ch) |
int |
lastIndexOf(int ch,
int fromIndex) |
int |
lastIndexOf(String string) |
int |
lastIndexOf(String subString,
int start) |
int |
length() |
boolean |
regionMatches(boolean ignoreCase,
int toffset,
String other,
int ooffset,
int len) |
boolean |
regionMatches(int thisStart,
String string,
int start,
int length) |
String |
replace(char oldChar,
char newChar) |
String |
replace(CharSequence target,
CharSequence replacement) |
boolean |
startsWith(String prefix) |
boolean |
startsWith(String prefix,
int toffset) |
CharSequence |
subSequence(int start,
int end) |
String |
substring(int beginIndex) |
String |
substring(int beginIndex,
int endIndex) |
char[] |
toCharArray() |
String |
toLowerCase() |
String |
toString() |
String |
toUpperCase() |
String |
toUpperCase(Locale locale) |
String |
trim() |
static String |
valueOf(boolean b) |
static String |
valueOf(char c) |
static String |
valueOf(char[] data,
int offset,
int count) |
static String |
valueOf(double d) |
static String |
valueOf(float f) |
static String |
valueOf(int i) |
static String |
valueOf(long l) |
static String |
valueOf(Object obj) |
public static final Comparator<String> CASE_INSENSITIVE_ORDER
public String()
public String(byte[] bytes)
public String(byte[] bytes,
int off,
int len)
public String(byte[] bytes,
int off,
int len,
String enc)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic String(byte[] bytes,
Charset charset)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic String(byte[] bytes,
String enc)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic String(char[] value)
public String(char[] value,
int offset,
int count)
public String(String value)
public String(StringBuffer buffer)
public String(StringBuilder buffer)
public char charAt(int index)
charAt in interface CharSequencepublic int compareTo(String anotherString)
compareTo in interface Comparable<String>public int compareToIgnoreCase(String anotherString)
public boolean contentEquals(CharSequence cs)
public boolean contentEquals(StringBuffer sb)
public static String copyValueOf(char[] data)
public static String copyValueOf(char[] data, int offset, int count)
public boolean endsWith(String suffix)
public boolean equalsIgnoreCase(String anotherString)
public byte[] getBytes()
public byte[] getBytes(String enc) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic byte[] getBytes(Charset charset) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic void getChars(int srcBegin,
int srcEnd,
char[] dst,
int dstBegin)
public int indexOf(int ch)
public int indexOf(int ch,
int fromIndex)
public int indexOf(String str)
public int indexOf(String str, int fromIndex)
public String intern()
public int lastIndexOf(int ch)
public int lastIndexOf(int ch,
int fromIndex)
public int lastIndexOf(String string)
public int lastIndexOf(String subString, int start)
public int length()
length in interface CharSequencepublic boolean regionMatches(boolean ignoreCase,
int toffset,
String other,
int ooffset,
int len)
public String replace(char oldChar, char newChar)
public String replace(CharSequence target, CharSequence replacement)
public boolean startsWith(String prefix)
public boolean startsWith(String prefix, int toffset)
public String substring(int beginIndex)
public String substring(int beginIndex, int endIndex)
public char[] toCharArray()
public String toLowerCase()
public String toString()
toString in interface CharSequencetoString in class Objectpublic String toUpperCase()
public String trim()
public static String valueOf(boolean b)
public static String valueOf(char c)
public static String valueOf(char[] data, int offset, int count)
public static String valueOf(double d)
public static String valueOf(float f)
public static String valueOf(int i)
public static String valueOf(long l)
public CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic boolean contains(CharSequence seq)
public boolean isEmpty()
public boolean regionMatches(int thisStart,
String string,
int start,
int length)
Copyright © 2026. All rights reserved.