Forums Register Login

need a better way to get months out of a string

+Pie Number of slices to send: Send
Hi,
I need to extact Months names out of a given string, I can do it easily using regular expressions

something like:
Pattern.compile(january|february|.....).matcher("22January")

so that I can get the month's name found in this string but I need more professional code for doing so, I mean these months must be defined in the Date class but i dont know how to reach to them
any ideas?
+Pie Number of slices to send: Send
Take a look at DateFormat and SimpleDateFormat

http://www.javaalmanac.com/egs/java.text/FormatDate.html

J.
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 677 times.
Similar Threads
How long does it take - roughly?
HashMap implementation for an interpreter: cannot find symbol error
many companies in less years
Princeton Consulting UK
Date differences in months...
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:06:41.