Categories:
Partners
Web Hosting
We've partnered with HostGator for reliable, affordable hosting starting at $3.95/mon. Use coupon code "javascriptkit25" for 25% off any package.

Strings in JavaScript Part 1 (formatting text)

String manipulation is an important part of JavaScript programming, and having recently been reminded that I have yet to write a tutorial on it, this one comes as long overdue. In Part 1 of "Strings In JavaScript", I'll discuss how to format the look of a string using the language, such as make it bold, convert it to uppercase etc.

The String object

Before we officially proceed, it's important to realize the existence of a String Object in JavaScript, and how it is created- whenever a variable contains text. Take the following as an example:

var sitename="JavaScript Kit"

In the above, "sitename" is not only a variable, but an instance of the String object as well.

Copyright 1997-2014 JavaScript Kit. NO PART may be reproduced without author's permission.