[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

Find / Replace Dates

I am writing a program that opens and reads all the files in a directory one at a time and if any occurences of the following are found, then the month is incremented by +1. also, if the current year is other than 2008, replace with current year.
'20080301'
'2008-08-18
'200808%'
'2008-08-01'
'200808
I've tried the System.Text.RegularExpressions and the replace() methods, but wanted to know if someone had a better approach.

Thanks in advance
pandkyon
0
pandkyon
Asked:
pandkyon
1 Solution
 
CodeCruiserCommented:
I think you are already using a good method. The regular expression is the answer to matching multiple words to a pattern. And the replace function would obviously do the actual replacing of the word for you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now