我想將兩個單獨的字符串"1982"
和"SEP"
解析爲一個java.time.YearMonth
對象。解析爲YearMonth
java.time.YearMonth.parse("1978 SEP", java.time.format.DateTimeFormatter.ofPattern("yyyy LLL"))
給我
java.time.format.DateTimeParseException: Text '1978 SEP' could not be parsed at index 5
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
at java.time.YearMonth.parse(YearMonth.java:295)