Content deleted Content added
added musical instruments and quanta |
No edit summary |
||
Line 3:
The term '''string''' in a broader sense refers to a sequence of entities; for example, tokens in a language grammar, a sequence of states in automata or a representation of [[DNA]].
== Representation in programming languages ==
A common representation is an [[array]] of characters. The length can be stored implicitly by using a special terminating character (often [[NUL]], ASCII code 0) -- the [[C programming language]] uses this convention -- or explicitly, for example by prefixing the string with integer value (convention used in [[Pascal programming language|Pascal]]).
Line 40:
Many [[UNIX]] utilities perform simple string manipulations and can be used to easily program some powerful string processing algorithms. Files and finite streams may be viewed as strings.
== Strings in theoretical computer science ==
In theoretical computer science, one starts with a [[empty set|non-empty]] [[finite]] [[set]] called the ''alphabet''; strings are then defined as finite sequences of elements from the alphabet, including the empty sequence. The set of all strings over a given alphabet, together with string concatentation, then forms a [[monoid]], in fact a free monoid. [[Formal language]]s, the central objects of study, are defined as [[subset]]s of this monoid.
-------------
|