java.lang.String.indexOf(char
ch)方法返回字符ch在指定字符串中第一次出现的下标索引位置如果字符ch在指定的字符串中找不到,则返回-1示例:import
java.lang.*;public class StringDemo { public static void....
分类:
编程语言 时间:
2014-05-08 13:02:04
阅读次数:
423
1:默认初始化如果对类中的变量不进行初始化,系统则会初始化变量为对应的值 比如int = 0,
bool = fase String = null;2:手动初始化变量private int age = 23;3:初始化块{ id = 201245; age
= 23;}4:构...
分类:
编程语言 时间:
2014-05-08 12:57:43
阅读次数:
361
#include #include void DataSwap(int* data1,
int* data2) { int temp = *data1; *data1 = *data2; *data2 = temp; }void
insertSort(int arr[],i...
分类:
编程语言 时间:
2014-05-08 12:54:22
阅读次数:
299
1.在typedef中使用指针往往会带来意外的结果。如下:typedef string
*pstring;const pstring cstr;绝大数人刚开始都会认为cstr是一种指针,它指向const对象,即const pstring cstr
等价于const string *cstr,其实,这...
分类:
其他好文 时间:
2014-05-08 12:52:54
阅读次数:
319
//文件远程下载 WebClient client = new WebClient(); Uri
uri = new Uri(url); client.DownloadFile(Uri uri,String
filename);//文件一定得存在不然会报错所以在删除文件时先判断这个文件是否存...
分类:
其他好文 时间:
2014-05-07 21:07:37
阅读次数:
284
#include "stdafx.h"#include #include #include using
namespace std;int main(){ //cin.imbue(locale("chs"));
cout.imbue(locale("chs"));//控制台输出中文 int i,le...
分类:
其他好文 时间:
2014-05-07 20:48:01
阅读次数:
288
一、单个参数:public List getXXBeanList(String
xxCode); 其中方法名和ID一致,#{}中的参数名与方法中的参数名一直, 我这里采用的是XXXBean是采用的短名字,select
后的字段列表要和bean中的属性名一致, 如果不一致的可以用 as 来补充。...
分类:
其他好文 时间:
2014-05-07 20:41:12
阅读次数:
281
public bool UnRAR(string destPath, string
rarfilePath) { try { // destPath = @"E:\youxiaodi\temp"; //目标位...
分类:
其他好文 时间:
2014-05-07 20:35:48
阅读次数:
322
ptr_fun是将一个普通的函数适配成一个functor,添加上argument
type和result type等类型,
其实现如下(例子里面是binary_function,unary_function同理):C++代码templateinlinepointer_to_binary_functi...
分类:
其他好文 时间:
2014-05-07 20:33:56
阅读次数:
393
通过跟踪Asp.net服务器代码,没有乱码,然而导出Excel到浏览器后,打开时出现乱码。解决方法是添加编码格式的前缀字节码:Response.BinaryWrite(System.Text.Encoding.Unicode.GetPreamble());Response.Clear();Respo...
分类:
Web程序 时间:
2014-05-07 20:29:11
阅读次数:
328