Contents

Views 29027 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
아래의 strBody에 search를 replace로 교체하는 방법..
NSMutableString *strBody = [NSMutableString stringWithString:_noticeInfo.body];
   
NSString *search = @"
";
NSString *replace = @"
";


1. range를 바꿔가며 패턴을 찾고 교체
NSRange range = [strBody rangeOfString:search];
while(range.location != NSNotFound){
    [strBody replaceCharactersInRange:range withString:replace];
    range = [strBody rangeOfString:search];
}


2. range를 문자열 전체로 잡고 한번에 교체
NSRange range = NSMakeRange(0, [strBody length]);
[strBody replaceOccurrencesOfString:search withString:replace options:NSLiteralSearch range:range];


?

  1. [ios] NSMutableString 문자열 패턴 교환

  2. [ios] NSData 클래스에 대해 (NSData <-> char*)

  3. [ios] NSData to NSString (NSString to NSData)

  4. [ios] None IB vs. StoryBoard 샘플 소스

  5. [ios] NavigationController 에서 왼쪽(back) 버튼 후킹하기

  6. [ios] Locale Identifiers

  7. [ios] libxml/tree.h file not found

  8. [ios] iphone SetDeviceOrientation 화면 강제 회전

  9. [ios] iOS에서 디바이스 종류 알아오기

  10. [ios] iOS앱의 Xcode 빌드 과정

  11. [ios] iOS 의 인앱구매 소개

  12. [ios] iOS 앱 아이콘을 만드는 유틸

Board Pagination Prev 1 ... 51 52 53 54 55 56 57 58 59 60 ... 98 Next
/ 98