Hello. I have a new blog.

I've moved this blog to the following URL Kerkness.ca. Thank you for visiting, please update your bookmarks.

Monday, February 18, 2008

PHP ucfirst() and ucwords() in Flex

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(' ');
}

1 comment:

Thank you for the comments.