Skip to content

Instantly share code, notes, and snippets.

@aksnell
Created June 1, 2020 13:24
Show Gist options
  • Save aksnell/752fbe45d9d1cfa581b1bd23a5a1a955 to your computer and use it in GitHub Desktop.
Save aksnell/752fbe45d9d1cfa581b1bd23a5a1a955 to your computer and use it in GitHub Desktop.
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