在Swift中,当我们想要截取某个字符串时,方法如下:let carNumber = "沪A12345"let startIndex = advance(userCar.carPlateNumber.startIndex, 0)let endIndex = advance(startIndex, 1...
分类:
移动开发 时间:
2014-10-31 18:57:23
阅读次数:
232
其实是通过js语句自己建的函数function request(strParame){ var args = new Object(); var query = location.search.substring(1); var pairs = query.split("&...
分类:
Web程序 时间:
2014-10-30 20:41:51
阅读次数:
207
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. For ...
分类:
其他好文 时间:
2014-10-30 11:46:27
阅读次数:
188
if (results.length() == 0) { return ""; } else { return results.substring(0, results.length() - 1); } 等价于return (results.length()>0)?(...
分类:
编程语言 时间:
2014-10-28 10:20:46
阅读次数:
239
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
[
["aa","b"],...
分类:
其他好文 时间:
2014-10-27 15:39:02
阅读次数:
227
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:
编程语言 时间:
2014-10-27 10:46:48
阅读次数:
230
字符串:string s = "1,2,3,4,5,"目标:删除最后一个 ","方法:1、用的最多的是Substring,这个也是我一直用的s = s.Substring(0,s.Length - 1)2、用TrimEnd,这个东西传递的是一个字符数组 s=s.TrimEnd(',')//如果要删除...
DP、KMP什么的都太高大上了,自己想了个朴素的遍历方法。
【题目】
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palin...
分类:
其他好文 时间:
2014-10-26 15:37:32
阅读次数:
249
【题意】
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...
分类:
其他好文 时间:
2014-10-26 11:49:53
阅读次数:
203
Given a string containing just the characters '(' and ')',
find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()",
...
分类:
其他好文 时间:
2014-10-26 11:49:43
阅读次数:
185