What’s a delimiter?

Print anything with Printful



A delimiter is a separator used to divide data into individual pieces in a file or communication protocol. It can be a single character or a sequence of non-printing control characters. Delimiters can be complicated by delimiter collisions. They can take the form of non-printing control characters or enclosing separators. Delimiters are used in many computer applications, including HTML.

In relation to computers, a delimiter is a separator that defines individual pieces of data in a file, communication protocol, or other data stream. The separator can be as simple as a single character, such as a comma, or as complex as a defined sequence of non-printing control characters. The purpose of a delimiter is to provide a predictable and reliable mechanism for dividing a stream of data into component parts when other methods may not be reliable or when the content of the data may be highly arbitrary. Many computer applications, from word processors to spreadsheets to web browsers, use delimiters for various functions. One complication that can arise with the use of a delimiter is known as a delimiter collision, which occurs when the expected data contains the separator as a character that should not be interpreted as a separator, compensating for the following data and usually invalidating it.

A delimiter can be a single character, such as a space separating words, as is the case with many command-line interpreters and basic word processors. The goal is to allow a program to isolate a single element from a longer string. For example, a website address uses periods to separate different parts of the site name.

Although commas, semicolons, and other forms of punctuation are commonly used as separators, there are instances where they aren’t practical, such as when accepting multiple lines of text that form a grammatically correct paragraph. In these cases, a delimiter can take the form of a nonprinting control character so that all printable characters can be used as data. A non-printing control character is a single character that does not have a corresponding display glyph in a computer font, is sometimes not even replicable on a keyboard, and must instead be generated by an application or other function. These types of separators work well in some cases, but can also be burdensome if a user is unable to produce the character without a special program. An example of this occurred in early command line editing programs, where a user had to use the “control-Z” key combination to generate the non-printing end-of-file (EOF) character to create a delimiter that marked the end of a file.

A more complex type of delimiter is designed to separate entire blocks of data by enclosing the data within opening and closing separators. These separators can take the form of parentheses — as seen in many programming languages ​​— quotes or asterisks. The goal is to provide a way to split a block of data or arbitrary text that might span multiple lines or include control characters or other special characters. In HyperText Markup Language (HTML), tags used to mark up text are surrounded by greater than and less than signs, allowing tags to be of any length and include control characters such as a carriage return generated when the Enter key is pressed without breaking the block. Using delimiters in this way allows you to format an HTML document to be more human-readable without creating problems for the HTML user agent.




Protect your devices with Threat Protection by NordVPN


Skip to content