Previous | Index | Next |
Substring extraction methods
stringsOfString:inString:options:
Returns an array of all matching substrings. Anchored and backwards search options don't make sense here.
+ (NSArray *)stringsOfString:(NSString *)toFind inString:(NSString *)aString options:(NSStringCompareOptions)compareOptions
toFind = the string to look for
aString = the string to search
compareOptions = Any of the NSStringCompareOptions
A list of matching strings
Version 1.2.0
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) + (current application's NSDiacriticInsensitiveSearch as integer))
ASify from theResult
--> {"string", "String"}
theResult as list
--> {"string", "String"}