- (NSMutableAttributedString *)stringColorStr:(NSString *)str String:(NSString *)string Color:(UIColor*)color{
NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@%@",str,string]];
NSRange redRange = NSMakeRange([[noteStr string] rangeOfString:string].location, [[noteStr string] rangeOfString:string].length);
[noteStr addAttribute:NSForegroundColorAttributeName value:color range:redRange];
return noteStr;
}
NSString *totalStr = @"这个是不需要改变颜色的字符串";
NSString *totalStr1 = @"这个是你要改变颜色的字符串";
[self.totalLabel setAttributedText:[RRPPrintObject stringColorStr:totalStr String:totalStr1 Color:IWColor(50, 50, 50)]];