What are string?

Explanation of string and everything related to it

Introduction

In Python, strings are immutable. This means that once a string is created, the contents of the string can not be changed.

All operations that modify the string will create a new string. This is because strings are stored in memory as a sequence of characters. They will be stored in a contiguous block of memory.

This makes most operations O(n).

The only fast operations are accessing a character at a specific index and checking the length of the string. Both of these operations are O(1).

WIP: Check this for C++

ASCII vs Unicode

Encoding

Decoding

String Manipulation