Object-c 语言

字符串操作:

http://www.myexception.cn/mobile/455287.html

1,判断两字符串是否相同

NSString *str1 = @"hello pepe";   
NSString *str2=[NSString stringWithFormat:@"hello %s","pepe"];
if([str1 isEqualToString:str2]){
NSLog(@"相同");
}
else{
NSLog(@"不同");
}

2,浮点型运算

  CGRect screenRect=[UIScreenmainScreen].bounds;

CGFloat widthf= (screenRect.size.height-self.adView.frame.size.width)/2;

CGFloat heighf=screenRect.size.width-self.adView.frame.size.height-50.0f;

posted @ 2013-09-10 11:19  韦斯利yx  阅读(316)  评论(0编辑  收藏  举报