String (computer Science) - String Datatypes - String Length

String Length

Although formal strings can have an arbitrary (but finite) length, the length of strings in real languages is often constrained to an artificial maximum. In general, there are two types of string datatypes: fixed-length strings, which have a fixed maximum length and which use the same amount of memory whether this maximum is reached or not, and variable-length strings, whose length is not arbitrarily fixed and which use varying amounts of memory depending on their actual size. Most strings in modern programming languages are variable-length strings. Despite the name, even variable-length strings are limited in length, although, in general, the limit depends only on the amount of memory available. The string length can be stored as a separate integer (which puts a theoretical limit on the length) or implicitly through a termination character, usually a character value with all bits zero. See also "Null-terminated" below.

Read more about this topic:  String (computer Science), String Datatypes

Famous quotes containing the words string and/or length:

    Amongst the learned the lawyers claim first place, the most self-satisfied class of people, as they roll their rock of Sisyphus and string together six hundred laws in the same breath, no matter whether relevant or not, piling up opinion on opinion and gloss on gloss to make their profession seem the most difficult of all. Anything which causes trouble has special merit in their eyes.
    Desiderius Erasmus (c. 1466–1536)

    Rivers must have been the guides which conducted the footsteps of the first travelers. They are the constant lure, when they flow by our doors, to distant enterprise and adventure; and, by a natural impulse, the dwellers on their banks will at length accompany their currents to the lowlands of the globe, or explore at their invitation the interior of continents.
    Henry David Thoreau (1817–1862)