Replace character at a particular position
Code:
function ConvertToUpperCase()
{
var result;
var numaric = "sonia";
var Character = numaric.charAt(0);
result=Character.toUpperCase();
//In Result char is coming in UpperCase
//I want how to replace the charater at postion 0 in numaric with result
}
Re: Replace character at a particular position
Are you just trying to make the first letter capitalized? If so, you're making it way too hard on yourself.
Code:
function ConvertToUpperCase(str) {
var tmp = str.charAt(0).toUpperCase();
return tmp + str.substr(1);
}