Objective C에서 python'sstr.format
메서드와 비슷한 문자열 형식을 지정하는 방법이 있습니까? @"this is {keyword_1}, and this is {keyword_2}"
키워드로 문자열을 가져 와서 @{@"keyword_2": @"bar", @"keyword_1": @"foo"}
사전을 사용하여 해당 키워드를 바꿔서 새로운 문자열 @"this is foo, and this is bar"
을 생성하고 싶습니다. 아니,키워드 별 Objective-C 문자열 형식
[NSString stringWithKeywordFormat:@"hello {user_name}, today is {day_of_week}!" keywords:@{@"user_name":@"Jack", @"day_of_week":@"Thursday"}];
처럼 보이는 내장 어디에도 없습니다. [GRMustache] (https://github.com/groue/GRMustache) 템플릿 라이브러리는 비슷한 것을 구현하는 것처럼 보이지만 (결코 사용하지 않았습니다.) – omz
@omz. 포인터 주셔서 감사. 제가 확인하겠습니다. –