deadlock Message Board
[ February Full List | Post A Reply ]

Re: Title Case Function
From Michael Hatch on 13 Feb '02
replying to Re: Title Case Function posted by DAle


I finally figured it out, it works something like this:

function titleCase()
var wordLength = this.word.length;
var result = this.word.substring(0,1).toUpperCase() +

this.word = result;
function titlestr(word)
this.word = word;
this.titleCase = titleCase;
function testwrite()
var testword = new titlestr("test");

then in the body you simply put in


Of course, I still need to do a little bit more work to make it
handle multiple words and so on, but the basic idea works. I
wrote the answer based on some info on netscapes web-site in a
discussion of custom objects.

I was really suprised at some of what you can do with them. I am
looking at making other scripts I have written more Object
Oriented using this technique.

Mike H.

Your Reply

*Your name:
*Message subject:
Home page title:
Home page URL:
(if you'd like to receive automatic replies by email)