动态的改变变量名称:$varname='bookPrice';$$varname=5;//等价于$bookPrice=5;问了问别人说用于字符串拼接,先记下来:$book='C++';$$book="10 yuan";echo $book." ".${$book};
分类:
Web程序 时间:
2014-09-15 09:58:18
阅读次数:
162
字符数组的两种定义方式: char c[10] = {‘i’ , ‘P’ , ‘h’ , ‘o’ , ‘n’ , ‘e’}; char c[10] = “iPhone” ;字符串函数strlen()计算字符串的长度strcpy()字符串拷贝strcat()字符串拼接strcmp(...
分类:
其他好文 时间:
2014-09-14 23:19:37
阅读次数:
225
假定有一个方法isSubstring,可检查一个单词是否为其他字符串的字串。给定两个字符串s1和s2,请编写代码检查s2是否为s1旋转而成,要求只能调用一次isSubstring。(比如,waterbottle是erbottlewat旋转后的字符串。)分析:将两个s1拼接起来,调用isSubstri...
分类:
其他好文 时间:
2014-09-14 21:54:47
阅读次数:
210
");//返回第二个参数字符串在第一个字符串里出现的次数$int=substr_count("abcdeabcdeablkabd","ab");//返回第二个字符串在第一个字符串第一次出现的位置,第一个字符位置算0$int=strpos("asagaab","ab");//返回第二个字符串在第一个字...
分类:
Web程序 时间:
2014-09-14 17:59:37
阅读次数:
214
C++中处理split的函数,首先要了解几个函数C++中string自己带的find_first_of 或者find_first_not_offind_last_of 或者find_last_not_of函数原型为:可以用来超找字符串,char,char *三种类型string (1)size_t ...
分类:
编程语言 时间:
2014-09-14 14:03:47
阅读次数:
346
function msubstr($str, $start=0, $length, $charset="utf-8", $suffix=true) { ? ? ? ? if(function_exists("mb_substr")) ? ? ? ? ? ? $slice = mb_substr($str, $start, $length, $charset); ? ?...
分类:
其他好文 时间:
2014-09-13 10:47:55
阅读次数:
190
PHP substr()函数可以分割文字,但要分割的文字如果包括中文字符往往会遇到问题,这时可以用mb_substr()/mb_strcut这个函数,mb_substr() /mb_strcut的用法与substr()相似,只是在mb_substr()/mb_st...
分类:
Web程序 时间:
2014-09-12 23:35:34
阅读次数:
404
SELECT INSTR('AAAC', 'AAC') FROM DUAL; --2SELECT SUBSTR('ABC', 2, 1) FROM DUAL; --BSELECT 'AA' || CHR(ASCII('B') + 1) FROM DUAL; -- AACSELECT * FROM V...
分类:
数据库 时间:
2014-09-12 21:59:14
阅读次数:
427
function uuid() { ? ? ? ? $charid = md5(uniqid(mt_rand(), true)); ? ? ? ? $hyphen = chr(45);// "-" ? ? ? ? $uuid = chr(123)// "{" ? ? ? ? ? ? ? ?.substr($charid, 0, 8).$hyphen ...
分类:
其他好文 时间:
2014-09-12 17:29:44
阅读次数:
159
Sub Macro1() For d = 1 To 9 For e = 2 To 70 For c = 1 To 225 If InStr(Worksheets(2).Cells(d, e), Worksheets(3).Cells(c, 1)) > 0 Then Worksheets(...
分类:
其他好文 时间:
2014-09-12 16:46:43
阅读次数:
213