Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

String manipulation methods

Method

arrayFromCSV:commaIs:

Summary

Converts comma-separated values to a list of lists.

Signature

+ (NSArray *)arrayFromCSV:(NSString *)aString commaIs:(NSString *)commaString

Parameters

aString = comma-separated string

commaString = the (single) comma character to use

Result

An array of arrays

Availability

Version 1.0.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set aString to "1,2,3" & linefeed & "4,\"5,00\",6" & linefeed & "7,8,9"

set theResult to current application's SMSForder's arrayFromCSV:aString commaIs:","

ASify from theResult

--> {{"1", "2", "3"}, {"4", "5,00", "6"}, {"7", "8", "9"}}

theResult as list

--> {{"1", "2", "3"}, {"4", "5,00", "6"}, {"7", "8", "9"}}


Click here to open script in a script editor