Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

List manipulation methods

Method

arrayByTrimmingBlanksFrom:

Summary

Trim any blank items from both ends of the list. Blanks are missing value, empty strings, empty lists, and lists consisting only of the above.

Signature

+ (NSArray *)arrayByTrimmingBlanksFrom:(NSArray *)listOrArray

Parameters

listOrArray = list or array

Result

An array

Availability

Version 1.0.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set listOrArray to {{}, "", 1.1, 2, "", 3, 4, {"", ""}, 5, missing value, 6, {missing value, ""}, {}}

set theResult to current application's SMSForder's arrayByTrimmingBlanksFrom:listOrArray

ASify from theResult

--> {1.1, 2, "", 3, 4, {"", ""}, 5, missing value, 6}

theResult as list -- 10.11 only

--> {1.1, 2, "", 3, 4, {"", ""}, 5, missing value, 6}

theResult as list -- 10.9 and 10.10

--> {1.100000023842, 2, "", 3, 4, {"", ""}, 5, missing value, 6}



Click here to open script in a script editor