Hello,
I am a javascript newbie and I'm stick at one place.
I have a requirement where I will get a sentence in a variable
example
var v1 ="This is a sentence"
Now I have to change the sentence to Capitalize case where the first
alphabet of every word will be in caps
So for above example the output should be
This Is A Sentence
I have found some scripts that can change case to uppercase or
lowercase but I'm not able to come up with a solution for this.
One more thing, there is no limit on the number of words that I'll get
in the sentence. I may get one word or even ten words.
I'm looking for a solution that will work for all scenarios,
Regards,
Rayne
I am a javascript newbie and I'm stick at one place.
I have a requirement where I will get a sentence in a variable
example
var v1 ="This is a sentence"
Now I have to change the sentence to Capitalize case where the first
alphabet of every word will be in caps
So for above example the output should be
This Is A Sentence
I have found some scripts that can change case to uppercase or
lowercase but I'm not able to come up with a solution for this.
One more thing, there is no limit on the number of words that I'll get
in the sentence. I may get one word or even ten words.
I'm looking for a solution that will work for all scenarios,
Regards,
Rayne
Comment