Empty string
From Wikipedia, the free encyclopedia
The empty string is the unique string of no characters over some alphabet Σ, and is denoted ε or λ. The length of this empty string is 0.
Under concatenation, the empty string is the identity element of the free monoid on Σ. That is, for any string s, sε = εs = s.
[edit] Representations
In many programming languages, the empty string is denoted with two double quotes: "" The empty string is also sometimes noted by the Greek letter λ.
[edit] Implementation
There are various means of implementing an empty string, depending on the programming language in use.
In C, the empty string is represented by a character array with a null character in the zeroeth position. Note that all strings in C are terminated by a null character.
In Perl, an empty string is represented by the absence of text between two quotes. Per the Perl language, this can take several forms. For example, '' (two single quotes), "" (two double quotes), and qw() (the quoting operator) would all generate a valid empty string.