xcode - 문자열 관련 함수
문자열 합치기
NSString* loc_lat = [ NSString stringWithFormat:@"%d/%d/%d\n", Point_num, curLocation.latitude, curLocation.longitude];
숫자->문자열 변환
remem.subtitle=[ NSString stringWithFormat:@"%d", 123];
문자열->숫자 변환
tmpNumber = [tmpStr intValue];
문자열 : 몇번째문자출력
NSLog(@"%C",[@"ABCDEF" characterAtIndex:3]);
문자열검색
if([childrenPlus[i] length]!=1 && parents_child==0){
if([childrenPlus[i] rangeOfString:m_MemberPhone].length)
{
NSLog(@"자식 정보가 들어가 있음(%d)",i);
chkpoint[i]=12;
}else{
NSLog(@"자식 정보가 없음(%d)",i);
}}}
문자열파싱
NSString *myString = @"1/asdf/qwerwer";
NSArray *myWords = [myString componentsSeparatedByString:@"/"];
// 이제 myWords는: [@"This", @"is", @"a", @"test"]
UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:@"text Point"
// message: (NSString*)myWords
message: [myWords objectAtIndex:1]
//message:[aps objectForKey: @"alert"]
delegate:self
cancelButtonTitle:@"확인"
otherButtonTitles:nil] ;
[alert2 show];
[alert2 release];