The String Object Chapter 6 s tutorial introduced you
The String Object Chapter 6 s tutorial introduced you to the concepts of values and the types of values that JavaScript works with features, such as strings, numbers, and Boolean values. In this chapter, you look more closely at the very important String data type, as well as its relationship to the Number data type. Along the way, you encounter the many ways in which JavaScript enables scripters to manipulate strings. Note Much of the syntax that you see in this chapter is identical to that of the Java programming language. Because the scope of JavaScript activity is narrower than that of Java, you don t have nearly as much to learn for JavaScript as for Java. At the same time, certain string object language features apply to scripting but not to Java programming. Improvements to the string object s methods in Navigator 4 greatly simplify a number of string manipulation tasks. If you must script for a lower common denominator of browser, however, you may need some of the same kind of string micro-management skills that a C programmer needs. I soften the blow by providing some general purpose functions that you can plug into your scripts to make those jobs easier. String and Number Data Types Although JavaScript is not what is known as a strongly typed language, you still need to be aware of several data types because of their impact on the way you work with the information in those forms. In this section, I focus on strings and two types of numbers. Simple strings A string consists of one or more standard text characters between matching quote marks. JavaScript is forgiving in one regard: You can use single or double quotes, as long as you match two single quotes or two double quotes around a 34 CHAPTER …. In This Chapter How to parse and work with text Performing search- and-replace operations Scripted alternatives to text formatting ….
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.