-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString010.java
More file actions
36 lines (29 loc) · 1.16 KB
/
Copy pathString010.java
File metadata and controls
36 lines (29 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package strings;
/**
* Created by WERT on 09.01.2017.
*/
public class String010 {
public static void main(String[] args) {
// примеры создания строк класса StringBuilder
StringBuilder strBld1 = new StringBuilder("Это большая строка");
String str1 = "не";
strBld1.insert(4, str1);
System.out.println("strBld1 = " + strBld1);
str1 = null;
strBld1.insert(strBld1.length(), " ");
strBld1.insert(strBld1.length(), str1);
System.out.println("strBld1 = " + strBld1);
String009 str009 = new String009("!!! ");
strBld1.insert(0, str009);
System.out.println("strBld1 = " + strBld1);
strBld1.delete(25, 108);
System.out.println("strBld1 = " + strBld1);
strBld1.deleteCharAt(0);
System.out.println("strBld1 = " + strBld1);
strBld1.replace(0, 2, "**");
System.out.println("strBld1 = " + strBld1);
System.out.println("reverse = " + strBld1.reverse());
System.out.println("index ** = " + strBld1.indexOf("**"));
System.out.println("index !! = " + strBld1.indexOf("!!"));
}
}