www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons JavaScript Strings Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
Lesson 28
Lesson 29
Lesson 30
Lesson 31
Lesson 32
Lesson 33
Lesson 34
Lesson 35
Lesson 36
Lesson 37
Lesson 38
Lesson 39
Lesson 40
Lesson 41
Lesson 42
Lesson 43
Lesson 44
Lesson 45
Lesson 46
Lesson 47
Lesson 48
Lesson 49

Like any other programming language strings are important in JavaScript too. The sequence of characters that we use in our programs are referred to as strings in JavaScript and in several other programming languages too.

There are some important points to remember when working with strings. We can apply comparison operators on them. We can use the concatenation operator (+) to concatenate two or more strings together. See the following example:

str1 = "Today";

str2 = "is Friday";

str3 = str1+ str2;


Adding Strings and Numbers:

Whe we try to add two numbers we get their sum as a result and when we try to add a string with a number we get a string as a result. The following example illustrates this further:

num= 5;

str = "This is number ";

result = str + num; // variable result now has the value This is number 5

When working with string and nummerical variables always remember that the result of adding a string to a number is always a string.


Next >>> Lesson No. 11: JavaScript for Loop





Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.