scriptingBeginsWith:
オブジェクトはレシーバの先頭と合うかを返します
-(BOOL)scriptingBeginsWith:(id)object:
解説
オブジェクトはレシーバの先頭と合うかを返します。
返り値
( BOOL )
YES/NO
引数
( id )object
オブジェクト
フレームワーク
Foundation
クラス
NSScriptingComparisonMethods
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSAttributedString *aString = [[NSAttributedString alloc] initWithString:@"abc"]; NSAttributedString *bString = [[NSAttributedString alloc] initWithString:@"ab"]; ([aString scriptingBeginsWith:bString]) ? NSLog(@"YES") : NSLog(@"NO"); } @end