teach-ict.com logo

THE education site for computer science and ICT

1. Introduction

In this section, we will discuss how to manipulate string and character variables. We will look at how to add or copy data to and from them, how programs can check what's in them, and how to change strings into other data types (we will use Python syntax for our examples)

 

A string variable stores text rather than a number. The string is made up of a set of characters that can also include spaces, symbols and numbers.

 

Examples of strings

                    "a"
                    "this is a string"
                    "0145955"
                    "this is a string with numbers 1223"
                    "*$&££^"((*££&&*$$$"

 

image