Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Substring extraction methods

Method

stringsOfString:inString:options:locale:

Summary

Returns an array of all matching substrings. Anchored and backwards search options don't make sense here.

Locale may affect results.

Signature

+ (NSArray *)stringsOfString:(NSString *)toFind inString:(NSString *)aString options:(NSStringCompareOptions)compareOptions locale:(NSLocale *)aLocale

Parameters

toFind = the string to look for

aString = the string to search

compareOptions = Any of the NSStringCompareOptions

aLocale = theLocale to use

Result

A list of matching strings

Availability

Version 1.2.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set aString to "This is a string. And this also part of the STRING."

set theResult to current application's SMSForder's stringsOfString:"string" inString:aString options:(current application's NSCaseInsensitiveSearch)

ASify from theResult

--> {"string", "STRING"}

theResult as list

--> {"string", "STRING"}

set theLocale to current application's NSLocale's localeWithLocaleIdentifier:"tr"

set theResult to current application's SMSForder's stringsOfString:"string" inString:aString options:(current application's NSCaseInsensitiveSearch) locale:theLocale

ASify from theResult

--> {"string"}

theResult as list

--> {"string"}


Click here to open script in a script editor