SlideShare a Scribd company logo
String Handling
All programming languages have predefined functions which allow the
manipulation of text strings. Some examples:
LEFT – get a number of characters at the left of the string
RIGHT – get a number of characters at the right of the string
MID – get a number of characters in the middle of the string
LEN / LENGTH – get the length of the string
toUPPER & toLOWER – convert string to upper or lower case characters
TRIM – remove characters from start or end of string, or remove whitespace
from start or end of a string
Most programming languages will include many more string handling functions.
String Handling
String Handling
Example
Duncastle Rugby Club have a computerised system which scans membership
cards and logs the date and time of arrival of members along with the member
name and address. An example string would be:
“13:21 05012016 Johnstone 14 High St, Duncastle DC13 2BZ”
They want the program to display the arrival time of a member on screen when
they scan their card.
String Handling
Example
String Handling
Example
Note that LiveCode does not have a LEFT function, instead it works with
characters in a string
String Handling
Example
A program is required to count the number of times that the letter “A” appears in
an inputted block of text.
String Handling
Example
String Handling
Example
Note that LiveCode does not have a MID function, instead it works with
characters in a string

More Related Content

PPTX
Data types slides by Faixan
PPSX
Assembly language programming
PPT
CASE Statements
PPT
SD & D Standard Algorithms
PPT
SD & D Variable Scope
PPT
SD & D Sequential Files
PPT
SD & D Design
PPTX
Programming in C by SONU KUMAR.pptx
Data types slides by Faixan
Assembly language programming
CASE Statements
SD & D Standard Algorithms
SD & D Variable Scope
SD & D Sequential Files
SD & D Design
Programming in C by SONU KUMAR.pptx

Similar to String Handling (20)

PPTX
cunit1.pptx
PPT
Ch07 assembly language marwadi university.ppt
PPTX
Programming construction tools
PPT
01. introduction
PDF
C programming introduction for beginners.pdf
PPTX
Input-output
PPT
ODS Page Breaking
PPTX
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
PPT
01. Introduction.ppt
PPTX
COMPUTER SYSTEM.pptx
ODP
C prog ppt
PPTX
Presentation of c2
PPTX
3 address code ujjwal matoliya.pptx
PDF
Python assignment 4
PPT
Strings v.1.1
PPTX
UNIT 2 ECSE-2.pptx
DOCX
Mca5010 web technologies
PPTX
Intermediate code representations
PPT
Compiler chapter six .ppt course material
cunit1.pptx
Ch07 assembly language marwadi university.ppt
Programming construction tools
01. introduction
C programming introduction for beginners.pdf
Input-output
ODS Page Breaking
C++ Introduction to basic C++ IN THIS YOU WOULD KHOW ABOUT BASIC C++
01. Introduction.ppt
COMPUTER SYSTEM.pptx
C prog ppt
Presentation of c2
3 address code ujjwal matoliya.pptx
Python assignment 4
Strings v.1.1
UNIT 2 ECSE-2.pptx
Mca5010 web technologies
Intermediate code representations
Compiler chapter six .ppt course material
Ad

More from Forrester High School (20)

PPTX
Program Design
PPTX
Database Evaluation
PPTX
PPTX
Database Query Design
PPTX
Data Dictionary
PPTX
Compound Keys
PPTX
Entity Occurrence Diagrams
PPTX
Entity Relationship Diagrams
PPTX
Database Analysis
PPTX
Software Evaluation
PPTX
Software Testing
PPTX
Standard Algorithms
PPTX
File Handling
PPTX
Python Predefined Functions
PPTX
Python Substrings
PPTX
Variable Scope
PPTX
Sub-programs
PPTX
Records in Python
PPTX
Parallel arrays in python
Program Design
Database Evaluation
Database Query Design
Data Dictionary
Compound Keys
Entity Occurrence Diagrams
Entity Relationship Diagrams
Database Analysis
Software Evaluation
Software Testing
Standard Algorithms
File Handling
Python Predefined Functions
Python Substrings
Variable Scope
Sub-programs
Records in Python
Parallel arrays in python
Ad

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Complications of Minimal Access Surgery at WLH
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
GDM (1) (1).pptx small presentation for students
Computing-Curriculum for Schools in Ghana
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Microbial diseases, their pathogenesis and prophylaxis
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Abdominal Access Techniques with Prof. Dr. R K Mishra
Final Presentation General Medicine 03-08-2024.pptx
Complications of Minimal Access Surgery at WLH
102 student loan defaulters named and shamed – Is someone you know on the list?
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
O5-L3 Freight Transport Ops (International) V1.pdf
VCE English Exam - Section C Student Revision Booklet
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Microbial disease of the cardiovascular and lymphatic systems
STATICS OF THE RIGID BODIES Hibbelers.pdf
GDM (1) (1).pptx small presentation for students

String Handling

  • 2. All programming languages have predefined functions which allow the manipulation of text strings. Some examples: LEFT – get a number of characters at the left of the string RIGHT – get a number of characters at the right of the string MID – get a number of characters in the middle of the string LEN / LENGTH – get the length of the string toUPPER & toLOWER – convert string to upper or lower case characters TRIM – remove characters from start or end of string, or remove whitespace from start or end of a string Most programming languages will include many more string handling functions. String Handling
  • 3. String Handling Example Duncastle Rugby Club have a computerised system which scans membership cards and logs the date and time of arrival of members along with the member name and address. An example string would be: “13:21 05012016 Johnstone 14 High St, Duncastle DC13 2BZ” They want the program to display the arrival time of a member on screen when they scan their card.
  • 5. String Handling Example Note that LiveCode does not have a LEFT function, instead it works with characters in a string
  • 6. String Handling Example A program is required to count the number of times that the letter “A” appears in an inputted block of text.
  • 8. String Handling Example Note that LiveCode does not have a MID function, instead it works with characters in a string