Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

23

Lesson Tasks

  • Watch the Lesson video
    Make notes on your notes sheet.
  • Read the lesson notes
    Make notes on your notes sheet.
  • Complete the learning activities
    Make any notes on your notes sheet.
  • Check the Learning outcomes
    Update your learning objectives

What do I need to Learn?

I need to learn how to convert a string to an interger or real data type and visa versa.
I know how to find the length of a string.
I need to learn how to find a substring of a string

Key Terms

Strings Series of characters identifier Array of characters Substring String length Concatenation

String manipulation - Learning Activities


Strings are bits of text. They can be defined as anything between quotes:

Get the character at position 3 (remember that the first character has the position 0):


Click on the button below to find out more about string operationsn

Basic String Operations

Coding activities

1. Calculate String length USERINPUT - User enters a string
OUTPUT - The length of the string is returned as an outp

2. Calculate Character Position
USERINPUT - The user enters a string
USERINPUT - The user enters a character
OUTPUT - The position of the character in the string is output

3. Concatenate strings
USERINPUT - The user enters a string
USERINPUT - The user enters a second string
OUTPUT - A string is then output that combines the two strings entered

4. Calculate Sub string
USERINPUT - The user enters a string
USERINPUT -The user enters a starting position (integer)
USERINPUT - The user enters an ending position (integer)
OUTPUT - A substring is then output

Click on the button below and complete as many exercises as you can

String exercises

Extension
Create your own program that includes all aspects of the learning objectives.

Learning Outcomes

I can copy code to manipulate a string variable.

I can create my own code to manipulate a string variable.

I can use all of the string operations in my own program which I have created.

Update your objectives

control