回答編集履歴
3
編集
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
```java
|
14
14
|
|
15
|
-
|
15
|
+
e.printStackTrace();
|
16
16
|
|
17
17
|
```
|
18
18
|
|
2
追記
test
CHANGED
@@ -27,3 +27,59 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
ちなみに、こちらの環境で提示されている現象は発生しません。Nzcさんと同じ結果です。
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
```java
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
public static void main(String[] args) {
|
42
|
+
|
43
|
+
try {
|
44
|
+
|
45
|
+
String strModule_info_data1 = "<山田>";
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
System.out.println("strModule_info_data1=" + strModule_info_data1);
|
50
|
+
|
51
|
+
System.out.println("きた1=" + strModule_info_data1.substring(0, 1));
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
if (strModule_info_data1.substring(0, 1).equals("<") == true) {
|
56
|
+
|
57
|
+
System.out.println("きた2");
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
} catch (Exception e) {
|
62
|
+
|
63
|
+
System.out.println("e.getMessage()=" + e.getMessage());
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
> きた2は、表示されません。★の行で例外で飛んでしまうので。
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
```java
|
78
|
+
|
79
|
+
if (strModule_info_data1.substring(0, 1).equals("<") == true) {
|
80
|
+
|
81
|
+
```
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
でないと、`System.out.println("きた2");` になるわけないのに、何がわからないというのでしょう?
|
1
tuiki
test
CHANGED
File without changes
|