/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var myString:String = "hello"; trace(myString); myString = catipaliseFirstLetter(myString); trace(myString); function catipaliseFirstLetter($s:String):String { return $s.substring(0, 1).toUpperCase() + $s.substr(1, $s.length-1); } // OUTPUT // hello // Hello