Jump to content

Prefix (computer science)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nils Grimsmo (talk | contribs) at 17:03, 29 March 2006 (moved Prefix of a string to Prefix (computer science): Proper naming.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A prefix of a string is a string such that , where . A proper prefix of a string is a prefix that is not equal to the string itself (it is shorter). A prefix can be seen as a special case of a substring.

Example

The string ban is a prefix of the string banana:

T = banana
    |||
P = ban

See also