Sha256: 7e3d0a45a7680966056d55be2ebdb644f3d1fe3b685b64e2c11b93f0213daa24
Contents?: true
Size: 558 Bytes
Versions: 165
Compression:
Stored size: 558 Bytes
Contents
using System; using System.Collections.Generic; using System.Linq; public static class RnaTranscription { private static readonly Dictionary<char, char> DnaToRna = new Dictionary<char, char> { { 'G', 'C' }, { 'C', 'G' }, { 'T', 'A' }, { 'A', 'U' } }; public static string ToRna(string nucleotide) { if (nucleotide.Any(x => !DnaToRna.ContainsKey(x))) { throw new ArgumentException("invalid nucleotide"); } return string.Concat(nucleotide.Select(x => DnaToRna[x])); } }
Version data entries
165 entries across 165 versions & 1 rubygems