Strings are useful for more than representing sentences and words. For example, genetic information is usually represented by character strings.
DNA is a double helix of two chains of nucleotides. Each nucleotide base can be represented by a single letter, and so a chain of nucleotides can be thought of as a string. Even though DNA has two chains (also called strands), the two are closely related: given one, it is easy to calculate the other. Thus, DNA is generally described by one string of characters representing the nucleotide bases of one of its strands.
The four bases that make up DNA are adenine (A), cytosine (C), guanine (G), and thymine (T).
The second strand of DNA is always the reverse complement of the first. ...