|
@@ -12,6 +12,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
|
|
|
+import static jdk.nashorn.internal.objects.NativeString.substr;
|
|
|
import static jdk.nashorn.internal.objects.NativeString.trim;
|
|
|
|
|
|
|
|
@@ -77,7 +78,8 @@ public class test {
|
|
|
*/
|
|
|
|
|
|
|
|
|
- A a = new A();
|
|
|
+
|
|
|
+/* A a = new A();
|
|
|
A b = new A();
|
|
|
List<A> list = new ArrayList<>();
|
|
|
|
|
@@ -159,9 +161,27 @@ public class test {
|
|
|
calendar.add(Calendar.YEAR, -1);
|
|
|
// 获取减去一年后的日期
|
|
|
Date newDate = calendar.getTime();
|
|
|
- System.out.println("减去一年后的日期: " + newDate);
|
|
|
+ System.out.println("减去一年后的日期: " + newDate);*/
|
|
|
|
|
|
+ String s="asdfkl.";
|
|
|
+ String t = s.trim();
|
|
|
+ if (substr(t,t.length()-1,t.length()).equals(".")){
|
|
|
+ System.out.println(t+"jpeg");
|
|
|
+ }
|
|
|
+ System.out.println(t);
|
|
|
+ s="asdfkl. ";
|
|
|
+ t = s.trim();
|
|
|
+ if (substr(t,t.length()-1,t.length()).equals(".")){
|
|
|
+ System.out.println(t+"jpeg");
|
|
|
+ }
|
|
|
+ System.out.println(t);
|
|
|
|
|
|
+ s="asdfkl123";
|
|
|
+ t = s.trim();
|
|
|
+ if (substr(t,t.length()-1,t.length()).equals(".")){
|
|
|
+ System.out.println(t+"jpeg");
|
|
|
+ }
|
|
|
+ System.out.println(t);
|
|
|
|
|
|
}
|
|
|
|