background preloader

Javascript

Facebook Twitter

Tutorial

Server. Jquery. Strings. Page last changed today See section 5F of the book. split() and toString() do not work in Netscape 2 and Explorer 3. substr() is not supported by Netscape 2 and 3, Explorer 3, Hotjava 3, Opera 3 and WebTV. This page has been translated into French. On this page I explain what strings are and then give an overview of some useful things you can do with them. Strings are simply groups of characters, like 'JavaScript', 'Hello world! ' When you write JavaScripts, you need to know what strings are and how they work. First I explain the basics of strings. String basics Let's review the basics of strings. When you declare and manipulate strings in JavaScript, always write them with single quotes ' or double quotes " around them. Let's introduce our two test strings that we'll use throughout this page: var a = 'Hello world! ' Now we have declared two variables, a and b and put strings in them.

Var b = 'I'm a JavaScript hacker var b = 'I\'m a JavaScript hacker.' var b = 'I\'m a JavaScript "hacker".' gives charAt.