提交 56a315de 编写于 作者: 奶油话梅糖's avatar 奶油话梅糖 🎨

upload

Signed-off-by: 奶油话梅糖's avatar奶油话梅糖 <xiaoyu13561171914@163.com>
上级 006a5b67
......@@ -200,7 +200,7 @@
<!-- 低版本浏览器警告 -->
<div id="lowBrowser">
<div></div>
<p><span>您的浏览器版本过低,不支持浏览本Wiki,请升级或更换您的浏览器再试!</span></p>
<p><span>您的系统WebView版本过低,不支持浏览本Wiki,请升级或更换您的浏览器再试!</span></p>
<script>
(function(win) {
var notice = document.getElementById('lowBrowser');
......
......@@ -23,6 +23,4 @@
##### 关注我们
- [关注微信公众号](?file=AboutUS/001-WeChat "001-微信")
- [关注哔哩哔哩](?file=AboutUS/002-Bilibili "002-B站")
##### 联系我们
- [查看如何联系我们](?file=Link_to_Us/01 "查看如何联系我们")
\ No newline at end of file
......@@ -143,23 +143,37 @@ String类是最常用的一个类,它用于生成字符串对象,对字符
在前边我们使用字符串时,是直接把字符串常量赋给了字符串对象。其实String类提供了如下一些常用的构造函数用来构造字符串对象:
(1)String()
构造一个空的字符串对象。
(2)String( char chars[ ] )
以字符数组chars的内容构造一个字符串对象。
(3)String( char chars[ ], int startIndex, int numChars )
以字符数组chars中从startIndex位置开始的numChars个字符构造一个字符串对象。
(4)String(byte [] bytes)
以字节数组bytes的内容构造一个字符串对象。
(5)String(byte[] bytes, int offset, int length)
以字节数组bytes中从offset位置开始的length个字节构造一个字符串对象。
#### 2、String类对象的常用方法
String类也提供了众多的方法用于操作字符串,以下列出一些常用的方法:
(1)public int length()
此方法返回字符串的字符个数。
(2) public char charAt(int index)
此方法返回字符串中index位置上的字符,其中index 值的 范围是0~length-1。
例如:
```java
......@@ -169,36 +183,67 @@ char ch1=str1.charAt(n-2); //获取字符串str1倒数第二个字符,ch1=’g
```
(3)public int indexOf(char ch)
返回字符ch在字符串中第一次出现的位置。
(4)public lastIndexOf(char ch)
返回字符ch在字符串中最后一次出现的位置。
(5)public int indexOf(String str)
返回子串str在字符串中第一次出现的位置。
(6)public int lastIndexOf(String str)
返回子串str在字符串中最后一次出现的位置。
(7)public int indexOf(char ch,int fromIndex)
返回字符ch在字符串中fromIndex位置以后第一次出现的位置。
(8)public lastIndexOf(char ch ,int fromIndex)
返回字符ch在字符串中fromIndex位置以后最后一次出现的位置
(9)public int indexOf(String str,int fromIndex)
返回子串str在字符串中fromIndex位置后第一次出现的位置。
(10)public int lastIndexOf(String str,int fromIndex)
返回子串str在字符串中fromIndex位置后最后一次出现的位置。
(11)public String substring(int beginIndex)
返回字符串中从beginIndex位置开始的字符子串。
(12)public String substring(int  beginIndex, int  endIndex)
返回字符串中从beginIndex位置开始到endIndex位置(不包括该位置)结束的字符子串。
(13)public String contact(String str)
用来将当前字符串与给定字符串str连接起来。
(14)public String replace(char oldChar,char newChar)
用来把串中所有由oldChar指定的字符替换成由newChar指定的字符以生成新串。
(15)public String toLowerCase()
把串中所有的字符变成小写且返回新串。
(16)public String toUpperCase()
把串中所有的字符变成大写且返回新串。
(17)public String trim()
去掉串中前导空格和拖尾空格且返回新串。
(18)public String[] split(String regex)
以regex为分隔符来拆分此字符串。
......
......@@ -276,4 +276,4 @@ public void setName(String name) {
## 5.5 变量的进一步讨论
我们可以把变量分为静态(static)变量、最终变量(final)和一般变量。一般把静态变量称为类变量,而把非静态变量称为实例变量。
\ No newline at end of file
我们可以把变量分为静态(static)变量、最终变量(final)和一般变量。一般把静态变量称为类变量,而把非静态变量称为实例变量。
# 第七图书馆
### H5+APP半离线轻量
### H5+APP半离线版
> 欢迎使用第七图书馆(The Seventh Library)
......@@ -9,8 +9,11 @@
<img src="amWiki/images/logo2.png" />
<p>梅糖Project矩阵产物,By奶油话梅糖</p>
</div>
<p>已支持适老化</p>
<img src="amWiki/images/by_older.png" />
<br>
### 欢迎使用第七图书馆
> **第七图书馆 致力于让大家可以更简单、更便捷的学习!**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册