Skip to main content

reverse_complement_str

Function reverse_complement_str 

Source
pub fn reverse_complement_str(seq: &str) -> String
Expand description

Reverse complements a DNA string, preserving case.

Returns the reverse complement of the input string. Unlike reverse_complement, this preserves the case of each base. Non-ASCII characters are passed through unchanged.

ยงExamples

use fgumi_dna::dna::reverse_complement_str;

assert_eq!(reverse_complement_str("ACGT"), "ACGT");
assert_eq!(reverse_complement_str("AAAA"), "TTTT");
assert_eq!(reverse_complement_str("acgt"), "acgt");