String Operations - Strings and Languages

Strings and Languages

A string is a finite sequence of characters. The empty string is denoted by . The concatenation of two string and is denoted by, or shorter by . Concatenating with the empty string makes no difference: . Concatenation of strings is associtive: .

For example, .

A language is a finite or infinite set of strings. Besides the usual set operations like union, intersection etc., concatenation can be applied to languages: if both and are languages, their concatenation is defined as the set of concatenations of any string from and any string from, formally . Again, the concatenation dot is often omitted for shortness.

The language consisting of just the empty string is to be distinguished from the empty language . Concatenating any language with the former doesn't make any change:, while concatenating with the latter always yields the empty language: . Concatenation of languages is associtive: .

For example, abbreviating, the set of all three-digit decimal numbers is obtained as . The set of all decimal numbers of arbitrary length is an example for an infinite language.

Read more about this topic:  String Operations

Famous quotes containing the words strings and, strings and/or languages:

    Met face to face, these Indians in their native woods looked like the sinister and slouching fellows whom you meet picking up strings and paper in the streets of a city. There is, in fact, a remarkable and unexpected resemblance between the degraded savage and the lowest classes in a great city. The one is no more a child of nature than the other. In the progress of degradation the distinction of races is soon lost.
    Henry David Thoreau (1817–1862)

    it was older sure than this year’s cutting,
    Or even last year’s or the year’s before.
    The wood was gray and the bark warping off it
    And the pile somewhat sunken. Clematis
    Had wound strings round and round it like a bundle.
    Robert Frost (1874–1963)

    Science and technology multiply around us. To an increasing extent they dictate the languages in which we speak and think. Either we use those languages, or we remain mute.
    —J.G. (James Graham)