1 NSString *str1 = @"123";2 NSString *str2 = [NSString stringWithFormat:@"%@", str1];3 大家明白, str1和str2在内存中的地址是不一样的.如果用 isEqual:比较两者, 明显返回值为 ...
分类:
其他好文 时间:
2016-01-26 23:36:40
阅读次数:
967
// 求字符串"158"和"39"按十进制数值做差后的结果以字符串形式输出 NSString *str1 = @"158"; NSString *str2 = @"39"; int a = [str1 intValue]; int b = [str2 intValue]; int c = a - b...
分类:
其他好文 时间:
2016-01-26 00:19:13
阅读次数:
205
本文转载自: http://rock3.info/blog/2013/12/05/hashtable%E6%B5%85%E6%9E%90/一、Hash特点 Hash,就是杂凑算法,Hash(str1)=str2,具备四种特性:长变短:Hash算法可以将任意长度的数据Hash成固定长度的数据。速...
分类:
其他好文 时间:
2016-01-25 11:17:11
阅读次数:
228
// Example3.cpp : 定义控制台应用程序的入口点。#include "StdAfx.h"#include #include using namespace std;int main(void){ string str,str1,str2; int index; //推断截取的子串是否由...
分类:
编程语言 时间:
2016-01-24 11:33:21
阅读次数:
136
"; //$array = explode("|",$s);拆分字符串,返回一个字符串的数组 *** $str1="aaaa|bbb|cc|d"; $array1=explode("|",$str1); print_r($array1); echo ""; ...
分类:
Web程序 时间:
2016-01-24 00:26:03
阅读次数:
175
B要传值给A1.控制器B中要有一个Block:typedef void (^MyBlock)(NSString* str1,NSString* str2);str1和str2里存放着要传递的参数2.还要有一个以Block为参数的方法-(void)chuanzhi:(MyBlock)block{ bl...
分类:
移动开发 时间:
2016-01-23 18:06:51
阅读次数:
172
php分割字符串的函数1,substr$str1 = substr($str,5);echo "从第5个字符开始取至最后:".$str1.";$str2 = substr($str,9,4);echo "从第9个字符开始取4个字符:".$str2.";$str3 = substr($str,-5);...
分类:
Web程序 时间:
2016-01-22 00:02:34
阅读次数:
264
主要用到String的两个方法,分别是subString(int len)或subString(int start,int end)和str.indexOf(String str1)思路:先判断指定字符串在原字符串的开头、中间或结尾。再根据不同情况或直接截取字符串或者先截取再拼接。代码如下:publ...
分类:
其他好文 时间:
2016-01-21 06:55:04
阅读次数:
278
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 map s0,s1; 8 char str0[90],str1[90]; 9 10 void zh(char str0[],in...
分类:
其他好文 时间:
2016-01-19 23:32:10
阅读次数:
163
public static string Md5JiaMi(string msg) { //用法TextBox1.Text = TongYong.Md5JiaMi(str1); //1.创建一个MD5对象 MD5 md5 = MD5.Creat...