String (computer science): Difference between revisions

Content deleted Content added
Fixed typos
Tags: Reverted possibly inaccurate edit summary references removed Visual edit Mobile edit Mobile web edit
Fixed typos
Tags: Reverted references removed Visual edit Mobile edit Mobile web edit
Line 12:
== Purpose ==
 
A primary purpose of strings is to store human-readable text, like words and sentences. Strings are used to communicate information from a computer program to the user of the program.<ref>{{cite webA |url=https://users.csprogram may also accept string input from its user.utah.edu/~germain/PPS/Topics/ Further, strings.html |website=Universitymay ofstore Utah,data Kahlertexpressed Schoolas ofcharacters Computingyet |title=Stringsnot intended for human reading.
|first=H. James |last=de St. Germain }}</ref> A program may also accept string input from its user. Further, strings may store data expressed as characters yet not intended for human reading.
 
Example strings and their purposes:
 
* A message like "<code>file upload complete</code>" is a string that software shows to [[end user]]susers. In the program's [[source code]], this message would likely appear as a [[string literal]].
* User-entered text, like "<code>I got a new job today</code>" as a status update on a [[social media]] service. Instead of a string literal, the software would likely store this string in a [[database]].
* Alphabetical data, like "<code>AGATGCCGT</code>" representing nucleic acid sequences of [[DNA]].<ref>{{cite web |url=https://plant-breeding-genomics.extension.org/dna-as-a-biochemical-entity-and-data-string/ |title=DNA as a Biochemical Entity and Data String |date=November 14, 2019 |first1=David M. |last1=Francis |first2=Heather L. |last2=Merk }}</ref>
* Computer settings or parameters, like "<code>?action=edit</code>" as a URL [[query string]]. Often these are intended to be somewhat human-readable, though their primary purpose is to communicate to computers.
 
The term string may also designate a sequence of data or computer records other than characters {{mdash}} like a "string of [[bit]]sbits" {{mdash}} but when used without qualification it refers to strings of characters.<ref name=Burchfield1986 />
 
==History==