Another common PHP function converted to ActionScript for use in a Flex application.
public function ucfirst( str:String ):String
{
return str.substr(0,1).toUpperCase()+str.substr(1);
}
public function ucwords( str:String ):String
{
var myArr:Array = str.split(' ');
for (var i:int in myArr ) {
myArr[i] = ucfirst( myArr[i] );
}
return myArr.join(' ');
}
Very Thanks! just the necesary!
ReplyDelete