Script for capitalisation not working

Script for capitalisation not working

I've seen this script posted many times and is even found under the toUpperCase as an example.  However, I can not get it to work.  The field name I am using is named "Name_Business".  Can anyone fill in the exact syntax for me to use the script below.  Thank you.

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; 
}