Jump to content

Empty string

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 169.231.46.33 (talk) at 10:28, 21 March 2008 (fixed null character). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer science and formal language theory, the empty string is the unique string of length zero. It is denoted with "λ" or sometimes ϵ.

Properties

When present in a formal language, empty strings have several properties:

  • . The string length is zero.
  • . Under concatenation, the empty string is the identity element of the free monoid on the alphabet Σ.
  • . Reversal of the empty string produces the empty string.

These properties may hold in some programming languages, but this is left up to the particular implementation.

Representations

Programming language λ representation
C, C++
{'\0'}
Perl
""
''
qw()
Python
""
''
str()

See also