1.字符串可以里面的字符可以像数组一样访问,比如$s = "123";$s[1]就等于2,如果字符串为中文则会乱码,需要使用mb_substr进行截取;2.php中的单引号(' ')是不需要编译解释直接输出的,双引号(" ")是需要经过编译解释的,然后再输出,所以单引号比双引号输出快,二双引号可以再...
分类:
Web程序 时间:
2014-07-16 22:51:17
阅读次数:
197
近日须要不同的编码,关于上述编码,一直迷迷糊糊,查了些资料,总算大致了解了,以下全是从网上搜来的:1.ASCII和Ansi编码 字符内码(charcter code)指的是用来代表字符的内码.读者在输入和存储文档时都要使用内码,内码分为 单字节内码 -- Single-Byte charact...
分类:
其他好文 时间:
2014-07-16 22:50:28
阅读次数:
215
函数fn:contains(string, substring) 如果参数string中包含参数substring,返回truefn:contains 判断字符串是否包含另外一个字符串 fn:containsIgnoreCase(string, substring) 如果参数string中包含参数s...
分类:
Web程序 时间:
2014-07-16 21:54:28
阅读次数:
265
题目链接:http://poj.org/problem?id=1298题目大意:按照所给的顺序要求将输入的字符串进行排列。 1 #include 2 #include 3 #include 4 using namespace std; 5 int main () 6 { 7 char ...
分类:
其他好文 时间:
2014-07-16 21:53:34
阅读次数:
186
我们先假设业务场景,是需要有这么一个扩展,提供一个叫ccvita_string的函数,他的主要作用是返回一段字符。(这个业务场景实在太假,大家就这么看看吧)对应的PHP代码可能是这样:function ccvita_string($str){ $result = 'Link'; return $.....
分类:
Web程序 时间:
2014-07-16 21:53:20
阅读次数:
278
前言一般来说,一个客户端APP并非独立存在的,很多时候需要与服务器交互。大体可分为两方面的数据,常规字符串数据和文件数据,因为这两种数据很可能传输方式不一样,比如字符串之类的数据,使用HTTP协议,选择json或xml作为数据传输结构,而以json最方便简洁,所以我们近年来的项目,就直接使用json...
分类:
移动开发 时间:
2014-07-16 21:50:47
阅读次数:
381
(Message App)The app just take the last 7 digits from a contact, then it does not create a converstion with the name of the contact that you are texti...
分类:
其他好文 时间:
2014-07-16 21:43:29
阅读次数:
203
1. 复制N个字符 String.prototype.repeat = function(num){ return (new Array(++num)).join(this);}var a = 'A';a.repeat(5); //'AAAAA'2. 替代if…else…var result;res...
分类:
Web程序 时间:
2014-07-16 21:33:45
阅读次数:
256
#include#includevoid getNext(int *Next,char* src){ int i,j; Next[0]=-1; i=0; j=-1; int N=strlen(src); while(i<N-1){ if(j==-1||src[i]==src[j]){ ++i;...
分类:
其他好文 时间:
2014-07-16 21:33:22
阅读次数:
222
第一次发现JavaScript中replace()方法如果直接用str.replace("-","!")只会替换第一个匹配的字符.而str.replace(/\-/g,"!")则可以全部替换掉匹配的字符(g为全局标志)。replace()Thereplace()methodreturnsthestr...
分类:
Web程序 时间:
2014-07-16 21:32:10
阅读次数:
276