Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is .....
分类:
其他好文 时间:
2014-11-21 15:51:15
阅读次数:
232
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon...
分类:
其他好文 时间:
2014-11-21 14:00:49
阅读次数:
172
asp.net字符串取前几位的时候总是很繁琐,于是我想了个偷懒的办法,代码如下: str.ToString().PadRight(20).Substring(0,10).Trim()
分类:
Web程序 时间:
2014-11-20 11:57:44
阅读次数:
215
coalesce( T.GoodsCode,'0') 若 T.GoodsCode 为NULL 这 用0替换round(S.SaleEarning,2) 保留两位小数SUBSTRING(zb.accTime,9,2) 截取字符 从第9个开始截取2个cast(SUBSTRING('11111111111...
分类:
数据库 时间:
2014-11-19 07:06:39
阅读次数:
366
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring
without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-11-19 01:35:20
阅读次数:
199
unction getArgs() {
var args = {}; //创建保存数据的对象
var qs = location.search.length > 0 ? location.search.substring(1) : ''; //取得查询字符串并去掉开头的问号
var items = qs.split('&'); //按&字符串拆分数组
var item = null, name = null, value = null;
//逐个将每一项添加到args对象中...
分类:
Web程序 时间:
2014-11-18 14:46:49
阅读次数:
149
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2014-11-17 22:29:25
阅读次数:
242
有时在显示某段文字的时候,可能会太长,影响我们页面的显示效果。如果仅是英文,那么我们可以用String.substring(start, end)函数就已经够用了。但是通常我们都会遇到既有英文,又有汉字的情况。而汉字是占用2个字节的,如果用String.substring(start, end)截取...
分类:
编程语言 时间:
2014-11-17 21:18:11
阅读次数:
184
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "aab...
分类:
其他好文 时间:
2014-11-16 17:23:33
阅读次数:
158
【题目】
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
...
分类:
其他好文 时间:
2014-11-16 17:22:42
阅读次数:
176