Bỏ qua đến nội dung
Bỏ qua điều hướng
Đăng nhập
MT.NET.VN

Viewbh Java Tut 48 String Methods 0 0 2023 04 04 04 31 52

Tìm kiếm
Thuộc khóa học · baihoc_sub = 16

Lập trình Java cơ bản ( Free)

Bài 21 / 49 trong khóa học.

Xem khóa học
43%
MT LEARNING · LESSON

Java Tut 48: String Methods 0 (0)

Java Tut 48: String Methods 0 (0)

Java Tut 48: String Methods 0 (0)

Tất cả các phương thức chuỗi

Lớp String có một tập hợp các phương thức dựng sẵn mà bạn có thể sử dụng trên các chuỗi.

MethodDescriptionReturn Type
charAt()Returns the character at the specified index (position)char
codePointAt()Returns the Unicode of the character at the specified indexint
codePointBefore()Returns the Unicode of the character before the specified indexint
codePointCount()Returns the Unicode in the specified text range of this Stringint
compareTo()Compares two strings lexicographicallyint
compareToIgnoreCase()Compares two strings lexicographically, ignoring case differencesint
concat()Appends a string to the end of another stringString
contains()Checks whether a string contains a sequence of charactersboolean
contentEquals()Checks whether a string contains the exact same sequence of characters of the specified CharSequence or StringBufferboolean
copyValueOf()Returns a String that represents the characters of the character arrayString
endsWith()Checks whether a string ends with the specified character(s)boolean
equals()Compares two strings. Returns true if the strings are equal, and false if notboolean
equalsIgnoreCase()Compares two strings, ignoring case considerationsboolean
format()Returns a formatted string using the specified locale, format string, and argumentsString
getBytes()Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte arraybyte[]
getChars()Copies characters from a string to an array of charsvoid
hashCode()Returns the hash code of a stringint
indexOf()Returns the position of the first found occurrence of specified characters in a stringint
intern()Returns the canonical representation for the string objectString
isEmpty()Checks whether a string is empty or notboolean
lastIndexOf()Returns the position of the last found occurrence of specified characters in a stringint
length()Returns the length of a specified stringint
matches()Searches a string for a match against a regular expression, and returns the matchesboolean
offsetByCodePoints()Returns the index within this String that is offset from the given index by codePointOffset code pointsint
regionMatches()Tests if two string regions are equalboolean
replace()Searches a string for a specified value, and returns a new string where the specified values are replacedString
replaceFirst()Replaces the first occurrence of a substring that matches the given regular expression with the given replacementString
replaceAll()Replaces each substring of this string that matches the given regular expression with the given replacementString
split()Splits a string into an array of substringsString[]
startsWith()Checks whether a string starts with specified charactersboolean
subSequence()Returns a new character sequence that is a subsequence of this sequenceCharSequence
substring()Returns a new string which is the substring of a specified stringString
toCharArray()Converts this string to a new character arraychar[]
toLowerCase()Converts a string to lower case lettersString
toString()Returns the value of a String objectString
toUpperCase()Converts a string to upper case lettersString
trim()Removes whitespace from both ends of a stringString
valueOf()Returns the string representation of the specified valueString

❮ TrướcKế tiếp ❯

ĐÁNH GIÁ NỘI DUNG 0.0/5 0 lượt đánh giá
Bạn thấy nội dung này thế nào?
Mỗi trình duyệt/tài khoản được chấm lại sau 24 giờ.
Báo bài lỗiGiúp MT.Net.VN phát hiện nội dung cần kiểm tra
Báo lỗi được ghi vào hệ thống để Admin kiểm tra. Không dùng chức năng này để gửi hỗ trợ cá nhân.

Bài học liên quan

Các bài khác có cùng khóa học cha theo baihoc_sub.

Bài học vừa xem

Lịch sử gần đây trên trình duyệt này.

Home Dịch vụ Khóa học CPanel