3 Replies Latest reply on Feb 19, 2010 5:15 AM by Ned Murphy

    Capitize First Letter

    TheBrody Level 1

      Why will this not work? I get back: "Welcome Back, DEFINED." The firstToUpper function will not run. I set the variable for Party already.

       

      Players = firstToUpper(Party);

       

      function firstToUpper(word) {
          firstLetter = word.substring(1, 0);
          restOfWord = word.substring(1);
          return (firstLetter.toUpperCase()+restOfWord);
         
          trace("hey")
      }
      Hiusername.text = ("Welcome Back, " + Players);