Schemaphic Systems Blog

Sharing experiences in Flash, Flex and AIR

Checks for empty string

with 2 comments

/**********************************************/

/*
* Checks whether a string is empty/blank
*
* @param: value:String – text value
* @returns: Boolean value – true if blank
*/
public function isBlank(value:String):Boolean
{
var tmpArray:Array = value.split(” “);

if (tmpArray.length <=0 )
return true;
var count:int = 0;

for (var i:int = 0; i < tmpArray.length; i++)
{
if (tmpArray[i].length <= 0 )
count++;
}

if (count == tmpArray.length)
return true;
return false;
}

Advertisements

Written by Deepanjan Das

June 7, 2010 at 10:59 AM

2 Responses

Subscribe to comments with RSS.

  1. Hi, I like your article. This is a cool site and I wanted to post a note to let you know, nice job! Thanks kim

    Louis Vuitton

    vuitton

    louis vuitton

    June 24, 2010 at 7:49 PM


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: