Member-only story
What is a String?
A basic data type (sure), but actually what is it?
It is simple to say that a String is just a collection of Characters. But what is that, and how can we use a String in your program?
Read on to find out.
Difficulty: Beginner | Easy | Normal | Challenging
Prerequisites:
- None, although it would help to understand zero-indexed arrays (guide HERE)
Terminology
Array: An ordered series of objects which are the same type
Character: A character, usually associated with a letter of the alphabet
Collection: A sequence of elements that can be traversed (as many times as you want) and can be accessed by an indexed subscript
Data types: A representation of the tyoe of data that can be processed, for example Integer or String
String: Is an NSAttributedString with additional methods for mutating the content
Strings:
A simple definition:
A string
is an ordered collection
of characters
. One example of a collection
is an Array
. Essentially we take a character
, and put it into an Array
.