I have this really long if else code
if (errorNumbers.Length == 6)
{
if (errorNumbers.Substring(0,4).Equals("1101") || errorNumbers.Substring(0,4).Equals("2121"))
{
retStr = "AutoRepickAfterPickError";
}
else if (errorNumbers.Substring(0, 4).Equals("1301") || errorNumbers.Substring(0, 4).Equals("2321"))
{
retStr = "AutoRepickAfterLAlignError";
}
else if (errorNumbers.Substring(0, 4).Equals("1401") || errorNumbers.Substring(0, 4).Equals("2221"))
{
retStr = "AutoRepickAfterCAlignError";
}
else if (errorNumbers.Substring(0, 4).Equals("1501") || errorNumbers.Substring(0, 4).Equals("2041"))
{
retStr = "AutoRepicksAfterManualRecovery";
}
etc…..
How I can rewrite it to something more nice .
Trying to learn here something new , and I am in .net 2.0.
Thanks for help.
I´d map the error codes in a dictionary like this: