Posted By

oppey on 05/23/11


Tagged


Versions (?)

文字列の検索


 / Published in: Objective C
 

  1. //(8)文字列内で、ある文字列を検索
str01 =@”あいうえお”;
NSRange searchResult = [str01 rangeOfString:@"うえ"];
  2. if (searchResult.location == NSNotFound) {printf(”見つかりません”);
} else {printf(”Position: %d, Length: %d です。\n”,
searchResult.location, searchResult.length);
}
  3.  

Report this snippet  

You need to login to post a comment.