Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
String (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Sequence of characters, data type}} [[File:String example.png|alt=Diagram of String data in computing. Shows the word "example" with each letter in a separate box. The word "String" is above, referring to the entire sentence. The label "Character" is below and points to an individual box.|thumb|Strings are typically made up of [[character (computing)|characters]], and are often used to store human-readable data, such as words or sentences.]] In [[computer programming]], a '''string''' is traditionally a [[sequence]] of [[character (computing)|characters]], either as a [[literal (computer programming)|literal constant]] or as some kind of [[Variable (computer science)|variable]]. The latter may allow its elements to be [[Immutable object|mutated]] and the length changed, or it may be fixed (after creation). A string is often implemented as an [[array data structure]] of [[byte]]s (or [[word (computer architecture)|word]]s) that stores a sequence of elements, typically characters, using some [[character encoding]]. More general, ''string'' may also denote a sequence (or [[List (abstract data type)|list]]) of data other than just characters. Depending on the programming language and precise data type used, a [[variable (programming)|variable]] declared to be a string may either cause storage in memory to be statically allocated for a predetermined maximum length or employ [[dynamic allocation]] to allow it to hold a variable number of elements. When a string appears literally in [[source code]], it is known as a [[string literal]] or an anonymous string.<ref>{{cite web|url=http://www.acsu.buffalo.edu/~fineberg/mfc158/week10lecture.htm|title=Introduction To Java – MFC 158 G|quote=String literals (or constants) are called ‘anonymous strings’|url-status=live|archive-url=https://web.archive.org/web/20160303233357/http://www.acsu.buffalo.edu/~fineberg/mfc158/week10lecture.htm|archive-date=2016-03-03}}</ref> In [[formal language]]s, which are used in [[mathematical logic]] and [[theoretical computer science]], a string is a finite sequence of [[symbol (formal)|symbol]]s that are chosen from a [[set (mathematics)|set]] called an [[alphabet (computer science)|alphabet]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)