SlideShare a Scribd company logo
Strings
Remember there are 3 types of variables we can
work with numbers, statements (if conditions)
and strings.
JavaScript strings are used for storing and
manipulating text.
What can we do with strings?

Copy the following and test it in dreamweaver
Substring shows the position of characters in a word entered.
<script type="text/javascript">
var name=prompt("enter your name","")
document.write(name.substring(0,1))
</script>
toUpperCase will make the word you enter be
produced by the program in upper case.
<script type="text/javascript">
var name=prompt("enter your name","")
document.write(name.toUpperCase())
</script>
tolowerCase will make the word you enter be produced by the
program in lower case. Try entering your name in upper case to
see it work.
<script type="text/javascript">
var name=prompt("enter your name","")
document.write(name.toLowerCase())
</script>
indexOf will give the position of a particular character/letter you
enter.
<script type="text/javascript">
var name=prompt("enter your name","")
document.write(name.indexOf(“a”))
</script>
Length will give the length of the word you enter such if you
entered hello, it would be 5 as it's 5 letters long.
<script type="text/javascript">
var name=prompt("enter your name","")
document.write(name.length)
</script>
Strings

More Related Content

PDF
Functions in php
PPTX
Php 101 by David Menendez
PPT
Introduction to perl_lists
PDF
Write codeforhumans
PDF
Practical TypeScript
PPTX
My first word press plugin
PPTX
Programming Primer EncapsulationVB
PPT
Convention Generator - Yi’s Eclipse Monkey Scripts for Coding ActionScript in...
Functions in php
Php 101 by David Menendez
Introduction to perl_lists
Write codeforhumans
Practical TypeScript
My first word press plugin
Programming Primer EncapsulationVB
Convention Generator - Yi’s Eclipse Monkey Scripts for Coding ActionScript in...

What's hot (12)

PPT
JavaScript Tutorial
PPTX
Hardened JavaScript
PPT
Javascript
PDF
Lazy Loading and Object Proxying Shenangians
PDF
Best practices naming conventions
PDF
SQL Limit in PHP
PDF
Ruby Metaprogramming
PPTX
Java script basic
PPTX
Js types
DOCX
Php mysql connectivity
PPTX
Php & my sql
DOCX
EPiServer report generation
JavaScript Tutorial
Hardened JavaScript
Javascript
Lazy Loading and Object Proxying Shenangians
Best practices naming conventions
SQL Limit in PHP
Ruby Metaprogramming
Java script basic
Js types
Php mysql connectivity
Php & my sql
EPiServer report generation
Ad

Viewers also liked (20)

ODP
Object Oriented Javascript
PPTX
Bringbestoinyou
PDF
PPTX
Functions and Objects in JavaScript
PDF
Javascript good parts - for novice programmers
PDF
Datatype
PPT
Javascript by geetanjali
PPTX
Javascript - Array - Writing
PPT
Tree and Binary Search tree
PDF
javascript objects
PPTX
Javascript - Array - Creating Array
PDF
Learn REST in 18 Slides
PDF
The JavaScript You Wished You Knew
PDF
Good Parts of JavaScript Douglas Crockford
PDF
JavaScript - From Birth To Closure
PPTX
Structure of url, uniform resource locator
PDF
JavaScript Functions
PPTX
Javascript para principiantes -Introducción
PDF
Introduction to JSON
PPTX
Basics of computer science
Object Oriented Javascript
Bringbestoinyou
Functions and Objects in JavaScript
Javascript good parts - for novice programmers
Datatype
Javascript by geetanjali
Javascript - Array - Writing
Tree and Binary Search tree
javascript objects
Javascript - Array - Creating Array
Learn REST in 18 Slides
The JavaScript You Wished You Knew
Good Parts of JavaScript Douglas Crockford
JavaScript - From Birth To Closure
Structure of url, uniform resource locator
JavaScript Functions
Javascript para principiantes -Introducción
Introduction to JSON
Basics of computer science
Ad

Similar to Strings (20)

PPT
JavaScript - An Introduction
PPT
Chapter 9 - Characters and Strings
PPT
Java căn bản - Chapter9
PDF
Javascript basics
PDF
Asp.Net MVC - Razor Syntax
ODP
PHP Web Programming
PPT
Manipulating strings
PPTX
javascriptbasicsPresentationsforDevelopers
PDF
Java script introducation & basics
 
PPTX
JavaScript.pptx
PDF
Intro to Programming for Communicators - Hacks/Hackers ATX
PPT
Debugging
PPS
Ruby 1.9.3 Basic Introduction
PPT
Javascript sivasoft
PDF
Handout - Introduction to Programming
PDF
Need help coding MorseCode in JavaCreate Class MorseCodeClient. T.pdf
PDF
Implode & Explode in PHP
PPTX
Javascript - Break statement, type conversion, regular expression
PPTX
Vb script final pari
PDF
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - An Introduction
Chapter 9 - Characters and Strings
Java căn bản - Chapter9
Javascript basics
Asp.Net MVC - Razor Syntax
PHP Web Programming
Manipulating strings
javascriptbasicsPresentationsforDevelopers
Java script introducation & basics
 
JavaScript.pptx
Intro to Programming for Communicators - Hacks/Hackers ATX
Debugging
Ruby 1.9.3 Basic Introduction
Javascript sivasoft
Handout - Introduction to Programming
Need help coding MorseCode in JavaCreate Class MorseCodeClient. T.pdf
Implode & Explode in PHP
Javascript - Break statement, type conversion, regular expression
Vb script final pari
JavaScript - Chapter 9 - TypeConversion and Regular Expressions

More from Max Friel (20)

PPTX
Assum 4
PPTX
Assum 3
PPT
Tourism
PPT
Practice programs
PPT
Project 1
PPT
Practice and debugging
PPT
Loops
PPT
Loops
PPT
If conditions
PPTX
Keywords used in javascript
PPT
Variables
PPT
Basics
ODP
Developing html skills 1
PPT
Matching game
ODP
activity flowcharts
PPT
Lesson one
PPT
Summer course
PPT
PPT
Phishing
PPT
Assum 4
Assum 3
Tourism
Practice programs
Project 1
Practice and debugging
Loops
Loops
If conditions
Keywords used in javascript
Variables
Basics
Developing html skills 1
Matching game
activity flowcharts
Lesson one
Summer course
Phishing

Recently uploaded (20)

DOCX
PRACTICE-TEST-12 is specially designed for those
PDF
Women’s Talk Session 1- Talking about women
PDF
ELA Parts of Speech Pronoun Educational Presentation in Green 3D Gradient Sty...
PDF
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
PPTX
_Dispute Resolution_July 2022.pptxmhhghhhh
PDF
MCQ Practice CBT OL Official Language 1.pptx.pdf
PDF
LSR CASEBOOK 2024-25.pdf. very nice casbook
PPTX
The-Scope-of-Food-Quality-and-Safety.pptx managemement
PPT
BCH3201 (Enzymes and biocatalysis)-JEB (1).ppt
PDF
Career Overview of John Munro of Hilton Head
PPTX
430838499-Anaesthesiiiia-Equipmenooot.pptx
PPTX
Prokaryotes v Eukaryotes PowerPoint.pptx
PPTX
PE3-WEEK-3sdsadsadasdadadwadwdsdddddd.pptx
PPTX
Overview Planner of Soft Skills in a single ppt
PDF
202s5_Luciano André Deitos Koslowski.pdf
PPT
ALLIED MATHEMATICS -I UNIT III MATRICES.ppt
PPTX
ChandigarhUniversityinformationcareer.pptx
PDF
Beyond the Lab Coat - Perjalanan Karier di Dunia Pasca-Fisika S1
PPTX
GPAT Presentation PPT and details about imp topics.pptx
PPTX
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
PRACTICE-TEST-12 is specially designed for those
Women’s Talk Session 1- Talking about women
ELA Parts of Speech Pronoun Educational Presentation in Green 3D Gradient Sty...
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
_Dispute Resolution_July 2022.pptxmhhghhhh
MCQ Practice CBT OL Official Language 1.pptx.pdf
LSR CASEBOOK 2024-25.pdf. very nice casbook
The-Scope-of-Food-Quality-and-Safety.pptx managemement
BCH3201 (Enzymes and biocatalysis)-JEB (1).ppt
Career Overview of John Munro of Hilton Head
430838499-Anaesthesiiiia-Equipmenooot.pptx
Prokaryotes v Eukaryotes PowerPoint.pptx
PE3-WEEK-3sdsadsadasdadadwadwdsdddddd.pptx
Overview Planner of Soft Skills in a single ppt
202s5_Luciano André Deitos Koslowski.pdf
ALLIED MATHEMATICS -I UNIT III MATRICES.ppt
ChandigarhUniversityinformationcareer.pptx
Beyond the Lab Coat - Perjalanan Karier di Dunia Pasca-Fisika S1
GPAT Presentation PPT and details about imp topics.pptx
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v

Strings

  • 1. Strings Remember there are 3 types of variables we can work with numbers, statements (if conditions) and strings. JavaScript strings are used for storing and manipulating text.
  • 2. What can we do with strings?  Copy the following and test it in dreamweaver Substring shows the position of characters in a word entered. <script type="text/javascript"> var name=prompt("enter your name","") document.write(name.substring(0,1)) </script>
  • 3. toUpperCase will make the word you enter be produced by the program in upper case. <script type="text/javascript"> var name=prompt("enter your name","") document.write(name.toUpperCase()) </script>
  • 4. tolowerCase will make the word you enter be produced by the program in lower case. Try entering your name in upper case to see it work. <script type="text/javascript"> var name=prompt("enter your name","") document.write(name.toLowerCase()) </script>
  • 5. indexOf will give the position of a particular character/letter you enter. <script type="text/javascript"> var name=prompt("enter your name","") document.write(name.indexOf(“a”)) </script>
  • 6. Length will give the length of the word you enter such if you entered hello, it would be 5 as it's 5 letters long. <script type="text/javascript"> var name=prompt("enter your name","") document.write(name.length) </script>