Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Empty string
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Formal theory<span class="anchor" id="nullable symbol"></span>== Formally, a string is a finite, ordered sequence of [[character (symbol)|characters]] such as letters, digits or spaces. The empty string is the special case where the sequence has length zero, so there are no symbols in the string. There is only one empty string, because two strings are only different if they have different lengths or a different sequence of symbols. In formal treatments,<ref>{{cite journal |first1=John |last1=Corcoran |first2=William |last2=Frank |first3=Michael |last3=Maloney |title=String theory |journal=Journal of Symbolic Logic |volume=39 |issue=4 |year=1974 |pages=625β637 |doi=10.2307/2272846 |jstor=2272846|s2cid=2168826 }}</ref> the empty string is denoted with '''[[Ξ΅]]''' or sometimes '''[[Ξ]]''' or '''[[Ξ»]]'''. The empty string should not be confused with the empty language [[β ]], which is a [[formal language]] (i.e. a set of strings) that contains no strings, not even the empty string. The empty string has several properties: * |Ξ΅| = 0. Its [[string (computer science)#Formal theory|string length]] is zero. * Ξ΅ β s = s β Ξ΅ = s. The empty string is the [[identity element]] of the [[concatenation]] operation. The set of all strings forms a [[free monoid]] with respect to β and Ξ΅. * Ξ΅<sup>R</sup> = Ξ΅. Reversal of the empty string produces the empty string, so the empty string is a [[palindrome]]. * <math>\forall c \in s: P(c)</math>. Statements that are about all characters in a string are [[vacuous truth|vacuously true]]. * The empty string precedes any other string under [[lexicographical order]], because it is the shortest of all strings.<ref>[http://cs.fit.edu/~ryan/cse1002/lectures/lexicographic.pdf CSE1002 Lecture Notes β Lexicographic]</ref> In [[context-free grammar]]s, a [[production (computer science)|production rule]] that allows a [[symbol (logic)|symbol]] to produce the empty string is known as an Ξ΅-production, and the symbol is said to be "nullable".
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)