String Manipulation By Felix Thompson, Jerzy Griffiths and Joel Sutcliffe.

Slides:



Advertisements
Similar presentations
Manipulating Strings String Functions. VB provides a large number of functions that facilitate working with strings. These are found in Microsoft.VisualBasic.Strings.
Advertisements

Chapter 3 DATA: TYPES, CLASSES, AND OBJECTS. Chapter 3 Data Abstraction Abstract data types allow you to work with data without concern for how the data.
AB 11 22 33 44 55 66 77 88 99 10  20  19  18  17  16  15  14  13  12  11  21  22  23  24  25  26  27  28.
 Basically, a sequence of characters  Character? › Like… a letter › Or a number › Or even blank space.
Alice Variables Pepper. Set to Java look Edit / preferences restart.
On to… string operations & functions. Concatenation (&) §When we want to combine two character strings into one new (longer) string, we can concatenate.
Chapter 5 Basic Functions Copyright 2005 Radian Publishing Co.
EXCEL FUNCTIONS MIS THE BASICS  LEFT(), RIGHT(), MID()  Keep X characters from string  CONCATENATE()  Join two strings together  TRIM()  Drop.
Hands on Projects Dr. Bernard Chen Ph.D. University of Central Arkansas July 9 th 2012
Manipulating Characters In today’s lesson we will look at: how text is stored inside the computer how we can use BASIC functions to manipulate and encipher.
Manipulation Masterclass By the VB Gods. In this masterclass, we will learn how to use some of the string manipulation function such as Len, Right, Left,
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
19/10/20151 Data Structures Arrays. 219/10/2015 Learning Objectives Explain initialising arrays and reading data into arrays. Design and write routine/s.
Manipulating Text In today’s lesson we will look at: why we might want to pick out parts of text strings some BASIC functions that can be used to chop.
String Manipulation. Strings have their own properties and methods, just like a textbox or label or form does.
Manipulating Strings. What is a string? Data composed of text characters. The data is stored in consecutive bytes of memory. Each byte stores the ASCII.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
1 Cannon_Chapter9 Strings and the string Class. 2 Overview  Standards for Strings  String Declarations and Assignment  I/O with string Variables 
Chapter 51 Decisions Relational and Logical Operators If Blocks Select Case Blocks.
 How do you represent a number with no value?  Mathematicians defined the “number” 0 (zero)  How do we represent a string with no value?  Use an empty.
Strings The Basics. Strings a collection data type can refer to a string variable as one variable or as many different components (characters) string.
C++ Programming Basics
String Manipulation 10/21/2015 Lect#6 GC Strings have their own properties and methods, just like a textbox or label or form does. 10/21/2015 Lect#6.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
Excel Text Functions 1. LEFT(text, [num_chars])) Returns the number of characters specified starting from the beginning of the text string Syntax Text:
A Level Computing#BristolMet Session Objectives#U2S11 MUST identify built-in string manipulation functions SHOULD correctly use string manipulation functions.
CHAPTER FOUR Performing Calculations and Manipulating Data: Expressions.
More String Manipulation. Programming Challenge Define a function that accepts two arguments: a string literal and a single character. Have the function.
Strings CSE 1310 – Introduction to Computers and Programming Alexandra Stefan University of Texas at Arlington 1.
CSC 162 Visual Basic I Programming. String Functions LTrim( string ) –Removes leading spaces from the left side of string RTrim( string ) –Removes trailing.
Chapter Four Common facilities of procedural languages.
String Manipulation Reference:
ENGINEERING 1D04 Tutorial 2. What we’re doing today More on Strings String input Strings as lists String indexing Slice Concatenation and Repetition len()
Introduction to Automata Theory Theory of Computation Lecture 6 Tasneem Ghnaimat.
Open Office Calc Session 03 Math and Text Functions.
Hello Educational presentation.
GCSE COMPUTER SCIENCE Practical Programming using Python
String Methods Programming Guides.
Unit 5 Lesson 6: User Input and Strings
BINARY CODE.
Representing Characters
SQL Text Manipulation Farrokh Alemi, Ph.D.
W Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
Manipulating Characters
Lesson 6: User Input and Strings
String Manipulation Reference:
Manipulating Text In today’s lesson we will look at:
Topics discussed in this section:
Alice Variables Pepper.
B Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
RAHUL KAVI SEPTEMBER 05, 2013 Day 6: Excel Chapters 3 & 4 RAHUL KAVI SEPTEMBER 05, 2013.
Comparing Strings – How to
H Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
B Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
W Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
Embedded PHP in HTML 5 & Strings in PHP
Digital Encodings.
String Manipulation Reference:
CSCI-N 100 Dept. of Computer and Information Science
H Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
W Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
Microsoft Visual Basic 2005: Reloaded Second Edition
15-110: Principles of Computing
The mid-point of two points.
W Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
W Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
Hello Hi Hello Hi Hello Hi Hello Hi Hello Hi Hello Hi.
W Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
H Customize this banner with your own message! Select the letter and add your own text. Use one character per slide.
Programming Techniques
Presentation transcript:

String Manipulation By Felix Thompson, Jerzy Griffiths and Joel Sutcliffe

What is string manipulation? String manipulation is interacting with strings to read information from them or limit what they can be. String manipulation is interacting with strings to read information from them or limit what they can be.

Reading data from a string Left – This reads a certain amount of characters in order going from left to right Left – This reads a certain amount of characters in order going from left to right Right– This reads a certain amount of characters in order going from right to left Right– This reads a certain amount of characters in order going from right to left Mid - This reads a certain length of the string going from a set point for a certain number of characters Mid - This reads a certain length of the string going from a set point for a certain number of characters

For example Text = Manipulation Text = Manipulation Left(Text, 5) would come as Manip Left(Text, 5) would come as Manip Right(Text, 6) would come as lation Right(Text, 6) would come as lation Mid(Text, 2,4) would come as nipu Mid(Text, 2,4) would come as nipu

Describing a string Locate – this tells you where in a string a certain character is. Locate – this tells you where in a string a certain character is. Length – this tells you the length of a string Length – this tells you the length of a string Locate(Text, “p”) would come out as 5 Locate(Text, “p”) would come out as 5 Len(Text) would come out as 12 Len(Text) would come out as 12

Character and ASCII values Asc - This returns the ASCII value of a single character. Asc - This returns the ASCII value of a single character. Chr – This returns the character of an ASCII value. Chr – This returns the character of an ASCII value. Asc(“B”) would come out as 66 Asc(“B”) would come out as 66 Chr(“66”) would come out as B Chr(“66”) would come out as B

Replace Use this to replace a set of characters to another set. Use this to replace a set of characters to another set. Text = hello world Text = hello world Replace(Text, “hello”, “goodbye”) Replace(Text, “hello”, “goodbye”) Text = goodbye world Text = goodbye world

Comparing strings When comparing strings it reads it as its ASCII value for example A < a because When comparing strings it reads it as its ASCII value for example A < a because A = 65 A = 65 a = 97 a = 97 a < ab because it adds the value together. a < ab because it adds the value together.