1.datastring str="hellow world";char *p =const_cast(str.data());2. c_strstring str="hello world";char *p=const_cast(str.c_str());3. str.copy()string s...
分类:
编程语言 时间:
2014-09-18 14:45:34
阅读次数:
169
header('Content-type:text/html;charset=utf-8');function cutstr($str){ #计算$str的字符个数 preg_match_all("/./u", $str, $len); $strlen = (int) count(...
分类:
其他好文 时间:
2014-09-18 12:51:33
阅读次数:
177
mysql日期和字符相互转换方法 date_format(date,‘%Y-%m-%d‘) ???-------------->oracle中的to_char(); str_to_date(date,‘%Y-%m-%d‘) ????-------------->oracle中的to_date(); %Y:代表4位的年份 %y:代表...
分类:
数据库 时间:
2014-09-18 11:39:24
阅读次数:
198
作者: EricHu出处: http://blog.csdn.net/chinahuyong1、原生JavaScript实现字符串长度截取[javascript]view plaincopyfunctioncutstr(str,len){vartemp;varicount=0;varpatrn=/[...
分类:
编程语言 时间:
2014-09-18 11:23:44
阅读次数:
472
在写python脚本的时候,经常需要调用系统命令,常用的python调用系统命令的方法主要有subprocess.call和os.popen。默认情况下subprocess.call的方法结果是返回值,即1或0,而os.popen则是命令运行的结果,可以用readlines(读取所有行,返回数组)或者read(读读取所有行,返回str..
分类:
编程语言 时间:
2014-09-18 03:09:33
阅读次数:
445
1、增加Logo 增加Logo即上传图片,因此使用到Struts2的文件上传功能。Struts2的文件上传依靠其FileUploadInterceptor(文件上传拦截器),其使用的依然是Apache提供的FileUpload文件上传组件(commons-fileupload.jar)。2、Str....
分类:
其他好文 时间:
2014-09-18 01:59:43
阅读次数:
225
1. 有时候程序需要生成一些临时目录和临时文件,在程序退出时需要删除,这时候用win32的api即可完成需求,自己遍历目录一个个removefile并不是高效率的做法.
//注意:
//1.要删除的目录不能以\\结尾.只能以目录名结尾,比如C:\\New Folder,而不是C:\\New Folder\\,不然会失败.
//2.pFrom的值必须是以\0结尾的字符串,unicode字符串要以两个\0\0结尾.
//3.可以使用std::string或std::wstring的c_str(),因为这个函数返...
#include#include#includeusing namespace std;int main(){ string str,p; cin>>str>>p; int n=str.length(); int m=p.length(); //compute ...
分类:
其他好文 时间:
2014-09-17 23:08:52
阅读次数:
248
1 package com.zhangcy.test.init; 2 3 public class Base { 4 5 int str; 6 static int val1=1; 7 final int val2=2; 8 static final i...
分类:
编程语言 时间:
2014-09-17 20:11:42
阅读次数:
247
在iOS项目开发中,有时候我们需要加载一段html文档,但又不能显示出文档中的标签,比如,等这样的标签这时我们可以用到如下方法来去除文档中的标签而只加载文本-(NSString *)flattenHTML:(NSString *)str{ NSScanner *theScanner; NSStr.....
分类:
移动开发 时间:
2014-09-17 18:34:02
阅读次数:
201