2016年1月23日

[iOS]URL编码和解码

摘要: 1. 首先来看下什么样的是URL编码(字符串中带有%22 类似这样的)NSString *str = @"http://m.tuniu.com/api/home/data/index/c/%7B%22v%22%3A%227.1.0%22%2C%22ct%22%3A20%2C%22dt%22%3A1%... 阅读全文

posted @ 2016-01-23 18:45 M_Lee 阅读(1133) 评论(0) 推荐(0)

[其他]正则表达式大全

摘要: 如何使用请参考http://www.cnblogs.com/lidongxu/p/5154413.html 常用正则表达式大全!(例如:匹配中文、匹配html) 1.匹配中文字符的正则表达式: [u4e00-u9fa5] 评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 2.匹配双字节字符(包 阅读全文

posted @ 2016-01-23 17:46 M_Lee 阅读(262) 评论(0) 推荐(0)

[算法]不用第三个数交换2个数的位置

摘要: int a = 10;int b = 20;第一种方法:a = a + b;b = a - b;a = a - b;第二种方法:a = a ^ b; (^ 语言中是异或的意思,同为0 异为1 1 ^ 1 = 0, 0 ^ 0 = 0, 1 ^ 0 = 1)b = a ^ b;a = a ^ b;第... 阅读全文

posted @ 2016-01-23 14:55 M_Lee 阅读(307) 评论(0) 推荐(1)

[iOS]把16进制(#871f78)颜色转换UIColor

摘要: //// ViewController.m// text//// Created by 李东旭 on 16/1/22.// Copyright © 2016年 李东旭. All rights reserved.//#import #import "ViewController.h"// 定义... 阅读全文

posted @ 2016-01-23 11:37 M_Lee 阅读(622) 评论(0) 推荐(0)

导航