An algorithm for encoding long strings of building blocks, like 4 DNA bases (adenine-A, cytosine-C, thymine-T, and guanidine-G), 20 natural amino acids (from Alanine Ala to Valine-Val, plus the stop triplet), or all 64 possible base triplets (from AAA to TTT), into "zigzag" or "spectrum-like" representations is suggested. The new encoding scheme can be derived in the 3-, 2-, or 1-dimensional form depending on the user's wishes. The only information, besides the string for which the "spectrum-like" representation is sought, is the initial positioning of the complete set of units from which the string is composed, i.e., four positions for A, C, G, and T, or 20 positions for natural amino acids plus stop, etc. This initial positioning can be initialized in either the 3-, 2-, or 1-D form. As an illustration of the suggested encoding scheme of the visual and chemometric comparison of the first 10 exon strings of the beta globin gene of 10 different species, each string consisting of about 100 basic amino acids long is shown.