String Manipulation and More Controls

Slides:



Advertisements
Similar presentations
Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
Advertisements

MIS: Chapter 14 Cumulative concepts, features and functions, plus new functions COUNTIFS, SUMIFS, AVERAGEIFS (Separate ppt on REACH.louisville.edu) All.
An Introduction to Programming with C++ Fifth Edition Chapter 12 String Manipulation.
Chapter 8: Manipulating Strings
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
CST JavaScript Validating Form Data with JavaScript.
Chapter 5 new The Do…Loop Statement
BACS 287 Visual Basic String Manipulation. BACS 287 Visual Basic Strings In Visual Basic, a “string” is a series of text, numbers, and special characters.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Ten String Manipulation and Menus.
1.
Chapter 8: String Manipulation
Programming with Microsoft Visual Basic th Edition
Strings IDIA 618 Spring 2013 Bridget M. Blodgett.
COMPUTER PROGRAMMING I Objective 7.04 Apply Built-in String Functions (3%)
Why to Create a Procedure
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 9 More About Strings.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
ASP.NET Programming with C# and SQL Server First Edition Chapter 5 Manipulating Strings with C#
Chapter Ten Structures and Sequential Access Files Programming with Microsoft Visual Basic th Edition.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Java Script: Arrays (Chapter 11 in [2]). 2 Outline Introduction Introduction Arrays Arrays Declaring and Allocating Arrays Declaring and Allocating Arrays.
 Agenda: 4/24/13 o External Data o Discuss data manipulation tools and functions o Discuss data import and linking in Excel o Sorting Data o Date and.
Fundamentals of Python: First Programs
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
ListBoxes Monday, March 21, 2011 Roxana Gheorghiu.
Chapter 8: Manipulating Strings
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 24 The String Section.
Chapter 12: String Manipulation Introduction to Programming with C++ Fourth Edition.
EXPRESSION Transformation. Introduction ►Transformations help to transform the source data according to the requirements of target system and it ensures.
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
CSCI 3327 Visual Basic Chapter 12: Strings, Characters and Regular Expressions UTPA – Fall 2011.
Using Text Files in Excel File I/O Methods. Working With Text Files A file can be accessed in any of three ways: –Sequential access: By far the most common.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Ten Structures and Sequential Access Files.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
AdditionalControls 1. The MenuStrip 2 Double-click Let’s begin to design the menu bar for VB! Let’s begin to design the menu bar for VB! 3.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
© 2006 Lawrenceville Press Slide 1 Chapter 6 The Post-Test Do…Loop Statement  Loop structure that executes a set of statements as long as a condition.
An Introduction to Programming with C++ Sixth Edition Chapter 13 Strings.
Decisions with Select Case and Strings Chapter 4 Part 2.
Excel Text Functions 1. LEFT(text, [num_chars])) Returns the number of characters specified starting from the beginning of the text string Syntax Text:
1 CSE 2337 Chapter 7 Organizing Data. 2 Overview Import unstructured data Concatenation Parse Create Excel Lists.
8 1 String Manipulation CGI/Perl Programming By Diane Zak.
Chapter 23 The String Section (String Manipulation) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Tutorial 8: Manipulating Strings1 Tutorial 8 Manipulating Strings.
[ ] Square brackets enclose syntax options { } Braces enclose items of which only one is required | A vertical bar denotes options … Three dots indicate.
02/03/ Strings Left, Right and Trim. 202/03/2016 Learning Objectives Explain what the Left, Right and Trim functions do.
Strings PART I STRINGS, DATES, AND TIMES. FUNDAMENTALS OF CHARATERS AND STRINGS VB represents characters using American National Standards Institute(ANSI)
© 2010 Lawrenceville Press Slide 1 Chapter 5 The Do…Loop Statement  Loop structure that executes a set of statements as long as a condition is true. 
Lecture Set 6 The String and DateTime Data Types Part B – Characters and Strings String Properties and Methods.
Tutorial 8: Manipulating Strings1 Tutorial 8 Manipulating Strings.
Microsoft Visual Basic 2008: Reloaded Third Edition
Objective 7.04 Apply Built-in String Functions (3%)
Computer Programming ||
Computer Programming BCT 1113
Excel REPT Function.
Chapter 5 The Do…Loop Statement
Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects Outline Test-Driving the Microwave Oven Application Designing.
Lists in Python.
CIS16 Application Programming with Visual Basic
Tonga Institute of Higher Education
CIS16 Application Development and Programming using Visual Basic.net
Microsoft Visual Basic 2005: Reloaded Second Edition
Microsoft Visual Basic 2005: Reloaded Second Edition
Topics Basic String Operations String Slicing
Topics Basic String Operations String Slicing
String Manipulation.
REACH Computer Resource Center
Topics Basic String Operations String Slicing
Presentation transcript:

String Manipulation and More Controls

Objectives Determine the number of characters contained in a string Remove characters from a string Replace one or more characters in a string Insert characters within a string Search a string for one or more characters Access characters contained in a string Compare strings Include radio buttons in an interface Include check boxes in an interface 1/3/2019 VB 2005

Manipulating Strings in Visual Basic Most applications need to manipulate string data in some fashion String properties and methods are used to manipulate string data 1/3/2019 VB 2005

Determining the Number of Characters Contained in a String Length Property Syntax String.length Example NumChar=ziptextbox.text.length 1/3/2019 VB 2005

Removing Characters from a String TrimStart method: removes one or more characters from the beginning of a string Syntax: String.TrimStart([trimChars]) TrimEnd method: removes one or more characters from the end of a string String.TrimEnd([trimChars]) 1/3/2019 VB 2005

Removing Characters from a String (continued) Trim method: removes one or more characters from both the beginning and end of a string Syntax String.TrimEnd([trimChars]) Each of these methods returns a string with the appropriate characters removed 1/3/2019 VB 2005

Removing Characters from a String (continued) trimChars argument: Comma-separated list of characters to be removed If omitted, spaces will be removed Default value is the space character: “ ” 1/3/2019 VB 2005

The Remove Method Index: Remove method: Removes characters from a string Can remove one or more characters located anywhere in the string Returns a string with the appropriate characters removed Syntax: string.rRemove(startIndex, count) Index: The position of a character in a string Is zero-relative (starts with 0 as first position) 1/3/2019 VB 2005

Replacing Characters in a String Replace method: replaces a sequence of characters in a string with another sequence of characters Syntax: String.Replace (oldValue, newValue) 1/3/2019 VB 2005

The Mid Statement Mid statement: Replaces a specified number of characters in a string with characters from another string targetString argument: the string in which characters are to be replaced replacementString argument: the replacement characters start argument: the starting position for the replacement count argument: number of characters to replace 1/3/2019 VB 2005

The Mid Statement (continued) Character position of characters in the string starts with 1 (not the same as index) Count argument is optional Syntax: Mid(targetString,start [,count])=ReplacementString 1/3/2019 VB 2005

Inserting Characters in a String PadLeft method: inserts characters at the beginning of a string Syntax String.PadLeft(Length[, Character]) PadRight method: inserts characters at the end of a string String.PadlRight(Length[, Character]) 1/3/2019 VB 2005

Inserting Characters in a String (continued) length argument: represents the total length of the desired resulting string character argument: The character used to pad the string Default value is the space character 1/3/2019 VB 2005