I have a project I am working on which runs a process if a value is identified in a file
if (read_txt.Contains("one") == true)
(do.something)
else if ((read_txt.Contains("two") == true)
(do.something.else)
else
(do.last.thing)
The (do.something) and (do.something.else) contains lots of things, like processes, if statements etc.
for example, (do.something) contains;
if (read_txt.Contains("one") == true)
write_log
process
read_file
if file.contains
write_log
else
write_log
process
process
if file.contains
write_log
else
write_log
The issue I have is that if the file in 'read_txt' contains both "one" and "two", i want to be able to run both elements, (do.something) and (do.something.else), without copying the code out again as there is quite a bit.
What would be the best way to do this?
I am a beginner with C# but this project is helping me learn quite quickly!!