I have a need of checking whether there is the date in the string or not.
FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string.
FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string.
FUTSTK ONGC 27 Mar 2008 -- There is date in the string.
How can I do that ?
What @danish is telling you is that you will need to try out RegEx (or regular expressions). There are tons of sites out there – MSDN; Practical Parsing; Learn Regular Expressions – just to name a few.
If you are expecting your date in only 2 specific formats, then we only have 2 patterns that we would need to match. Your example data:
provides us with 2 patterns:
ddMMMyyyydd Mmm yyyyThe example below will only look for a month in the short form. This should be enough to help you get going.
output: