teach-ict.com logo

THE education site for computer science and ICT

1. Introduction to strings

We discussed the different data types available to programmers in an early section, but with little detail.

In this section, we will discuss one data type in particular - strings. 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

String variables store character data. These characters can be letters, numbers, symbols, or can be blank (spaces). You can identify strings in psuedocode by the speech marks (" " or ' ') that mark their beginning and end

 

Examples of strings

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

image