Created
June 1, 2020 13:24
-
-
Save aksnell/752fbe45d9d1cfa581b1bd23a5a1a955 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class DnaStrand | |
{ | |
public static string MakeComplement(string dna) | |
{ | |
List<char> compliment = new List<char>(); | |
foreach (var nucleo in dna) | |
{ | |
switch (nucleo) | |
{ | |
case 'A': | |
compliment.Add('T'); | |
break; | |
case 'T': | |
compliment.Add('A'); | |
break; | |
case 'C': | |
compliment.Add('G'); | |
break; | |
case 'G': | |
compliment.Add('C'); | |
break; | |
} | |
} | |
return string.Join("", compliment); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment