I'm parsing text from an sms service using a java program, and I see that when using DateTimeFormatter 'E' or 'e' are the pattern characters for days of the week, and that the number of chars determines type of format (i.e. 'E' = T, 'EE' = Tu, 'EEE' = Tue, etc...) but in my program I'm never sure what format the message will include.
If I'm trying to check for the day of the week, can I check for all the formats using a single pattern? If not, when I'm checking for fully written out days (which vary in character length) how many E's in a row will include both Monday (6 letters) and Wednesday (9 letters)?
for example:
String singleWordFromMessage = "thursday";
LocalDateTime potentialDate = LocalDateTime.parse(singleWordFromMessage, DateTimeFormatter.ofPattern("EEEE"));
I'm missing how that works in the docs and my searches here have not been fruitful so far. Thanks in advance for any help.