Home > 类库下载 > java类库 > JAVA Basics String Basic Operations

JAVA Basics String Basic Operations

高洛峰
Release: 2016-10-19 09:28:26
Original
1552 people have browsed it

String str = "str";

str.length(); //3 Returns the length of the string

str.indexOf("s"); //0 Returns the index of s starting from 0; if not, returns -1

str.trim(); //"str" ​​Remove the spaces before and after str

str.substring(0,1); //"s" includes the beginning but not the end

str.charAt(0); // 's' Get the 0th character

str.startsWith("s") //true Whether it starts with s

str.endsWith("r") //true Whether it ends with r

str.toLowerCase() / /Convert all str to lowercase

str.toUpperCase() //Convert all str to uppercase

str.valueOf() //Convert the parameters brought in into string


Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Install JAVA
From 1970-01-01 08:00:00
0
0
0
Unable to install java
From 1970-01-01 08:00:00
0
0
0
Can java be used as the backend of the web?
From 1970-01-01 08:00:00
0
0
0
Is this in Java language?
From 1970-01-01 08:00:00
0
0
0
Help: JAVA encrypted data PHP decryption
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template