function ConvertToUpperCase()
{
var result;
var numaric = "sonia";
var Character = numaric.charAt(0);
result=Character.toUpperCase();
//In Result char is coming in UpperCase
/[B]/I want how to replace the charater at postion 0 in numaric with result[/B]
}
sonia sardana
-13
Posting Whiz
Recommended Answers
Jump to PostHi sonia,
you could try this:
function ConvertToUpperCase() { var result; var numaric = "sonia"; var Character = numaric.charAt(0); result = numaric.replace( Character, Character.toUpperCase() ); // Converting target character to uppercase letter. }
Jump to PostI would try something like:
function ConvertToUpperCase() { var result; var numaric = "sonia"; result=numaric.charAt(0).toUpperCase() + numaric.substring(1); }
This changes the first character to upper case and then adds the second and subsequent character to the end.
HTH
Stoo
--
<FAKE SIGNATURE>
All 6 Replies
essential
84
Posting Shark
Featured Poster
we evolve
0
Newbie Poster
essential
84
Posting Shark
Featured Poster
sonia sardana
-13
Posting Whiz
we evolve
0
Newbie Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
essential
commented:
Nice execution, simple and elegant...
+3
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.