转自:http://benchmarks.ro/2011/02/str_replace-vs-preg_replace/事实证明str_replace确实比preg_replace快。If you find yourself handling strings and replacing sub-st...
分类:
其他好文 时间:
2015-05-27 18:51:53
阅读次数:
121
题意:给一个字符串,问最多可以用多少个子串重复构成,例如ababab是3个ab组成的。解法:kmp模板题……以前做过……然而现在几乎忘了失败指针什么的怎么来的……http://kb.cnblogs.com/page/176818/讲的挺好的……根据最后一个字符记录的失败指针位置可以知道最后一个重复的...
分类:
其他好文 时间:
2015-05-26 21:08:17
阅读次数:
103
创建StringBuffer类以及toString,append()方法 //创建一个StringBuffer类 ,此类有两个方法:一个是append方法一个是toString方法 function StringBuffer() { this.__strings__ = []; ...
分类:
Web程序 时间:
2015-05-26 21:00:23
阅读次数:
199
Anagrams
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
解题思路:
anagrams(变位字)是指对于两个单词来说,长度相同,且构成的字符除了顺序可以不同外,个数都相同。如cinem...
分类:
其他好文 时间:
2015-05-26 18:56:20
阅读次数:
134
题目:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, ...
分类:
其他好文 时间:
2015-05-26 18:03:37
阅读次数:
129
:感觉介绍的浅显易懂,所以推荐
What is Redis?
Redis是 Salvatore Sanfilippo 开发的,开源的,高效的基于内存的键值缓存服务,所谓的NoSQL数据库 。它可以存储 strings, hashes, lists, sets, sorted sets等结构的数据。
键值存储的实质是能够存储数据,而且在之后调用具体的键名,可以检索出之前插入...
分类:
其他好文 时间:
2015-05-25 22:27:03
阅读次数:
264
如果有快捷键切换到了软件键盘,请切换输入法。Ctr+1:用于生成对错误提示信息的解决办法,比如要将中文字符写入到strings.xml中,用这个快捷键可以选择extractstring来完成。
分类:
系统相关 时间:
2015-05-25 20:34:41
阅读次数:
194
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.
注意:java中字符串求长度可以用s.length()方法,但是数组求长度直接一个a.length就可以了。
思路:先求最短字符串长度,之后从第一个字符串的第...
分类:
其他好文 时间:
2015-05-25 14:35:33
阅读次数:
103
No.49 AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Tags:Hash TableString难点...
分类:
其他好文 时间:
2015-05-25 14:13:21
阅读次数:
147
Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t.
All occurrences of a character must be replaced with anot...
分类:
其他好文 时间:
2015-05-24 18:59:44
阅读次数:
112