delimiter-prefixed string
Jump to navigation
Jump to search
About
In coding, a segmented string is a string value that contains multiple substrings of variable length divided by a specific character.
This is the most generally useful when the dividing character is defined as the first character in the string, so that the dividing character does not have to be set or passed separately. This makes it possible to store lists of short strings as a single value. The only constraint this adds is that the dividing character must not appear in any of the substrings; this technique is therefore most useful for predefined constants, where a dividing character can be chosen that won't conflict with the substring values and hopefully will help to visually set the values apart.
Examples:
"/one/two/three/four"
(dividing char = "/")" Monday Tuesday Wednesday Thursday Friday Saturday Sunday"
(dividing char = space)