1.求字符串中连续出现最多的字串pair substring(const string& str){ int i, j, k, len = str.length(), count, maxcount = 1; string substr; vector substrs; //...
分类:
其他好文 时间:
2015-07-25 19:48:41
阅读次数:
101
今天有人在群里问这两个的区别,借这个机会在这罗列下
substring(from,to)
开始和结束的位置,从零开始的索引
参数 描述
from 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。
to 可选。一个非负的整数,比要提取的子串的最后一个字符在 stringObject 中的位置多 1。如果省略该参数,...
分类:
Web程序 时间:
2015-07-25 16:51:45
阅读次数:
165
function build_order_no(){ return date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);}用uniqid获取一个基于当前...
分类:
Web程序 时间:
2015-07-24 20:39:48
阅读次数:
181
//打印整个html网页.//打印局部html网页 extjs中的例子bdhtml = window.document.body.innerHTML; startprint = (""); endprint = (""); printhtml = bdhtml.substr(bdhtml.index...
分类:
Web程序 时间:
2015-07-24 20:10:03
阅读次数:
136
系统自带的函数mb_substr可以截取多字节的字符strip_tags—从字符串中去除HTML和PHP标记通过这两个函数便可解决示例:$str="<span>我爱php</span>";echomb_substr(strip_tags($str),0,3,‘utf-8‘);输出:我爱p
分类:
Web程序 时间:
2015-07-24 18:42:50
阅读次数:
160
1 SELECT SUBSTR(SYS_CONNECT_BY_PATH(tb.name,'->'),3) name2 FROM table tb3 START WITH nvl(tb.parentid,0)=04 CONNECT BY PRIOR I...
分类:
数据库 时间:
2015-07-24 18:04:57
阅读次数:
185
first_value(tafd.adv_nushi_ryaku_name) over(partition by tafd.adv_nushi_code order by substr(tafd.fee_mgmt_num, 2, 11) desc, substr(tafd.fee_mgmt_eda,...
分类:
其他好文 时间:
2015-07-24 10:36:31
阅读次数:
92
jQuery(document).ready(function(){jQuery("div.groupheader").each(function(){$(this).text($(this).text().substr(3));});});
分类:
Web程序 时间:
2015-07-22 12:31:39
阅读次数:
112
首先我们来解释一下折半查找:1.对一组具有升序(降序)的序列取其中间值,啪一刀斩断,2.然后就进行比较啦,如果比较等于中间值,返回不解释。3.如果小于中间值,就将查找范围变成右(左)边。4.如果大于中间值,就将查找范围变成左(右)边。5.一直到左边参数大于右边为止咯..
分类:
编程语言 时间:
2015-07-21 18:58:17
阅读次数:
123
最近刷了好几次的oj,好受伤好多都是类似的题目。最长回文子串string preprocess(string &str)
{
string afterProcessStr="#";
for(int i=0;i<str.size();++i)
{
afterProcessStr += str.substr(i, 1)+"#";
}
return...
分类:
其他好文 时间:
2015-07-20 10:57:58
阅读次数:
111