Exam Prep.

Slides:



Advertisements
Similar presentations
Java
Advertisements

Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Strings.
Strings in Java 1. strings in java are handled by two classes String &
1 Working with String Duo Wei CS110A_ Empty Strings An empty string has no characters; its length is 0. Not to be confused with an uninitialized.
1 Strings and Text I/O. 2 Motivations Often you encounter the problems that involve string processing and file input and output. Suppose you need to write.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 8 Strings.
Java Programming Strings Chapter 7.
Strings An extension of types A class that encompasses a character array and provides many useful behaviors Chapter 9 Strings are IMMUTABLE.
 Basically, it’s a sequence of characters.  Character? › Like… a letter. › Or a number. › Or even blank space (like spaces tabs and newlines).
 Basically, a sequence of characters  Character? › Like… a letter › Or a number › Or even blank space.
The Class String. String Constants and Variables  There is no primitive type for strings in Java.  There is a class called String that can be used to.
28-Jun-15 String and StringBuilder Part I: String.
1 Strings and String Operations  What is a Strings?  Internal Representation of Strings  Getting Substrings from a String  Concatenating Strings 
Lesson 3 – Regular Expressions Sandeepa Harshanganie Kannangara MBCS | B.Sc. (special) in MIT.
Chapter 9 Creating Formulas that Manipulate Text Microsoft Office Excel 2003.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
CSCI 3327 Visual Basic Chapter 12: Strings, Characters and Regular Expressions UTPA – Fall 2011.
Characters The data type char represents a single character in Java. –Character values are written as a symbol: ‘a’, ‘)’, ‘%’, ‘A’, etc. –A char value.
String Manipulation Chapter 15 This chapter explains the String facilities. You have already seen some of the main methods of the String class.
Instructor: Craig Duckett Lecture 08: Thursday, October 22 nd, 2015 Patterns, Order of Evaluation, Concatenation, Substrings, Trim, Position 1 BIT275:
Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Project 1: Using Arrays and Manipulating Strings Essentials for Design JavaScript Level Two Michael Brooks.
1 Textual Data Many computer applications manipulate textual data word processors web browsers online dictionaries.
Characters, Strings, And The string Class Chapter 10.
Chapter 3: Classes and Objects Java Programming FROM THE BEGINNING Copyright © 2000 W. W. Norton & Company. All rights reserved Java’s String Class.
More Strings CS303E: Elements of Computers and Programming.
CSC Programming I Lecture 9 September 11, 2002.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming strings.
JavaScript VARIABLES AND DATA TYPES. OUTPUT WITHOUT ALERT OR FORM CONSOLE.LOG();
JavaScript Loops. Looping Want to be able to do things more than once Basic: for (var i=initial; while-clause; increment) { statement; }
Strings Methods in the String class Manipulating text in Java.
1 Predefined Classes and Objects Chapter 3. 2 Objectives You will be able to:  Use predefined classes available in the Java System Library in your own.
17-Feb-16 String and StringBuilder Part I: String.
Strings CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Computer Programming 2 Lab (1) I.Fatimah Alzahrani.
Declaring variables The type could be: int double char String name is anything you want like lowerCaseWord.
Lab String Concatenation String s3 = s1.concat(s2); String s3 = s1 + s2; s1 + s2 + s3 + s4 + s5 same as (((s1.concat(s2)).concat(s3)).concat(s4)).concat(s5);
Lesson 4 String Manipulation. Lesson 4 In many applications you will need to do some kind of manipulation or parsing of strings, whether you are Attempting.
Strings A String is a sequence of letters
Introduction to programming in java
Strings, Characters and Regular Expressions
Strings, StringBuilder, and Character
Variables and Data Types
JavaScript, continued.
Primitive Types Vs. Reference Types, Strings, Enumerations
Modern Programming Tools And Techniques-I Lecture 11: String Handling
String and StringBuilder
Chapter 7: Strings and Characters
MSIS 655 Advanced Business Applications Programming
Advanced String handling
Part a: Fundamentals & Class String
String and StringBuilder
Tonga Institute of Higher Education
String and StringBuilder
String and StringBuilder
JavaScript: Objects.
String Processing 1 MIS 3406 Department of MIS Fox School of Business
String Processing 1 MIS 3406 Department of MIS Fox School of Business
Introduction to Computer Science
String methods 26-Apr-19.
String Methods.
Strings CSE 1310 – Introduction to Computers and Programming
Strings in Java.
Python Strings.
Strings in Java Strings in Java are also a reference type.
Methods in the String class Manipulating text in Java
Pre-AP® Computer Science Quiz
Unit-2 Objects and Classes
What We Want To Do User enters: Mary Smith
Presentation transcript:

Exam Prep

Exams: Two Exams I just need to know how many seats Google form Mon @ 12 (section 002 – 11 am) Fri @ 8 (section 001 – 9:30 am) I just need to know how many seats Google form

Check pdf processing Download the test pdf Fill in your name and save it Close the pdf Reopen and check that it changed

JavaScript Strings

What We Want To Do User enters: Mary Smith We want to respond: Hi Mary! We know how to concatenate. How do we take part of a string?

Think of Scrabble tiles Each tile is a Strings Think of Scrabble tiles Each tile is a Letter Number Punctuation mark Space (blank)

A literal string must be inside double quotes or single quotes What is a String? A literal string must be inside double quotes or single quotes “this is a string” and this is not a string. Remember not to cut and paste

Concatenating (formally) It means combining two or more things into one thing + Anything can be concatenated “awe” + “some” = “awesome” Whitespace only matters inside quotes “a”+“b” same as “a” = “b” “a ” + “b” NOT the same as “a” + “b”

Substring A substring is also a String A substring is a part of another string “cake” is a substring of “birthday cake” so are “day”, “thd”, and “y cake” “they” is not, neither is “hello” or “dude” Will come back to how to extract substrings

Referencing characters Each character has a position Note that it starts at 0, not 1 H I M O 1 2 3 4 5

JavaScripts Strings Length: stringname.length Functions: stringname.function() Concatenation: + or stringname.concat() Lots more functions Use of negative index to come from end Built-in regular expressions Excellent summary

Useful Functions charAt() Character at the position indexOf() Position of the first found occurrence lastIndexOf() Position of the last found occurrence replace() Replaces the matched substring with a new substring search() Position of the match substr() Substring from start position for number of chars substring() Substring from position 1 to position 2 toLowerCase() Converts a string to lowercase letters toUpperCase() Converts a string to uppercase letters trim() Removes whitespace from both ends of a string

Lab Create a form that takes a full name and a birth year Pass both as parameters Procedure needs to Extract first name Compute age Print a message Happy nn Birthday, FirstName