To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

Empty string

From Wikipedia, the free encyclopedia

In formal language theory, the empty string, or empty word, is the unique string of length zero.

Formal theory

Formally, a string is a finite, ordered sequence of 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,[1] 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:

In context-free grammars, a production rule that allows a symbol to produce the empty string is known as an ε-production, and the symbol is said to be "nullable".

Use in programming languages

In most programming languages, strings are a data type. Strings are typically stored at distinct memory locations. This means that the same string (for example, the empty string) could be stored in two or more places in memory.

In this way there could be multiple empty strings in memory, in contrast with the formal theory definition, for which there is only one possible empty string. However, a string comparison function would indicate that all of these empty strings are equal to each other.

Even a string of length zero can require memory to store it, depending on the format being used. In most programming languages, the empty string is distinct from a null reference (or null pointer) because a null reference does not point to any string at all, not even the empty string. The empty string is a legitimate string, upon which most string operations should work. Some languages treat some or all of the following in similar ways: empty strings, null references, the integer 0, the floating point number 0, the Boolean value false, the ASCII character NUL, or other such values.

The empty string is usually represented similarly to other strings. In implementations with string terminating character (null-terminated strings or plain text lines), the empty string is indicated by the immediate use of this terminating character.

λ representation Programming languages
`""` C, C#, C++, Go, Haskell, Java, JavaScript, Julia, Lua, M, Objective-C (as a C string), OCaml, Perl, PHP, Python, Ruby, Scala, Standard ML, Swift, Tcl, Visual Basic .NET
`''` APL, Delphi, JavaScript, Matlab, Pascal, Perl, PHP, Python, Ruby, Smalltalk, SQL
`{'\0'}` C, C++, Objective-C (as a C string)
`std::string()` C++
`""s` C++ (since the 2014 standard)
`@""` Objective-C (as a constant `NSString` object)
`[NSString string]` Objective-C (as a new `NSString` object)
`q(), qq()` Perl
`str()` Python
`%{}`
`%()`
Ruby
`string.Empty` C#, Visual Basic .NET
`String.make 0 '-'` OCaml
`{}` Tcl
`[[]]` Lua

Examples of empty strings

The empty string is a syntactically valid representation of zero in positional notation (in any base), which does not contain leading zeros. Since the empty string does not have a standard visual representation outside of formal language theory, the number zero is traditionally represented by a single decimal digit 0 instead.

Zero-filled memory area, interpreted as a null-terminated string, is an empty string.

Empty lines of text show the empty string. This can occur from two consecutive EOLs, as often occur in text files, and this is sometimes used in text processing to separate paragraphs, e.g. in MediaWiki.

References

1. ^ Corcoran, John; Frank, William; Maloney, Michael (1974). "String theory". Journal of Symbolic Logic. 39 (4): 625–637. doi:10.2307/2272846. JSTOR 2272846.
2. ^ CSE1002 Lecture Notes – Lexicographic
This page was last edited on 8 June 2021, at 13:28
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.