Script for capitalisation
Hi,
I am using the following script in functions in order to make the first letter of text uppercase and the rest of the text lowercase:
string getCapitalised(string txt)
{
if ((input.txt).length() > 0)
{
input.txt = (((input.txt).subString(0,1)).toUpperCase()) + (input.txt).subString(1,(input.txt).length());
}
return input.txt;
}
Although it works when text is input in all lowercase, it does not work if text is input in all uppercase. Do I need to add a bit of script in order to do this?
Thanks