码迷,mamicode.com
首页 >  
搜索关键字:substring with conca    ( 3920个结果)
Powershell文件管理
get-alias-definitionget-childitem#dir的别名为get-childitem#只列出目录dir|where-object{$_-is[System.IO.DirectoryInfo]}dir|where-object{$_.PSIsContainer}dir|where-object{$_.Mode.Substring(0,1)-eq"d"}#只列出文件dir|where-object{$_-is[System.IO.FileInfo]}dir|wh..
分类:系统相关   时间:2015-07-16 22:33:26    阅读次数:188
索引和长度必须引用该字符串内的位置。参数名: length
问题:运行页面时,出现以下错误,当重新刷新页面后,页面正常显示:原因:使用SubString(int StartIndex,int length)方法时,没有做字符串长度的判断。可能使得字符串的长度小于该方法的length参数的值。解决办法:在使用SubString(int StartIndex,i...
分类:其他好文   时间:2015-07-16 19:09:38    阅读次数:169
[leetcode] Longest Palindromic Substring 多种解法
很经典的题目,求字符串中的最长回文子串。 (1)最朴素的解法 ---暴力 复杂度O(N³) 这也是最容易想到的方法,最外层循环枚举起点i,第二层循环从i+1开始向后枚举,第三层判断是不是回文串。最后取最长子串的返回。 代码比较简单,这里没有列出。 (2)中心扩展法。复杂度O(N²) 枚举每一个字符作为中心点向左右扩展。但是这里要注意,对于每一次扩展要分奇偶两种情况。否则可能会漏掉情况。 ...
分类:其他好文   时间:2015-07-16 09:52:23    阅读次数:141
Longest Palindromic Substring
现在还不是总结动态规划的时候,这次遇到了动态规划的新的一种:矩阵法(自己创的),可以是一维也可以是二维,更多为很少见。随着刷题量的增大,务必好好总结动态规划是什么,有哪些种类。class Solution { public: string longestPalindrome(string s) { int length = s.size(); int arr[1...
分类:其他好文   时间:2015-07-15 22:56:32    阅读次数:132
FZU2013 short problem
Problem DescriptionThe description of this problem is very short. Now give you a string(length N), and ask you the max sum of the substring which the ...
分类:其他好文   时间:2015-07-15 22:28:01    阅读次数:109
新闻发布系统笔记一
1.如果字符串太长,想实现鼠标放上去提示出所有的文字,默认显示一部分可以使用这种方法: title="${commentBack.content }">${fn:substring(commentBack.content,0,15) }...    a标签的title属性可以满足需要,fn是jstl的函数标签。 2.分页时要先查询出记录总条数,有时候需要根据条件查询出总条数,所有条...
分类:其他好文   时间:2015-07-15 19:24:18    阅读次数:267
常用的字符串的截取
string str="123abc456";int i=3;1 取字符串的前i个字符str=str.Substring(0,i); // orstr=str.Remove(i,str.Length-i);2 去掉字符串的前i个字符:str=str.Remove(0,i); // or str=st...
分类:其他好文   时间:2015-07-15 12:34:47    阅读次数:75
String性能优化
String 使用的优化建议其他 String 使用的优化建议以上我们描述了在我们的大量文本分析案例中调用 String 的subString方法导致内存消耗的问题,下面再列举一些其他将导致内存浪费的 String 的 API 的使用:String 拼接的方法选择在拼接静态字符串时,尽量用 +,因为...
分类:其他好文   时间:2015-07-15 08:09:37    阅读次数:213
IndexOf、LastIndexOf、Substring的用法
paste fromhttp://www.cnblogs.com/xinyu1020/articles/1785858.htmlString.IndexOfString.IndexOf 方法 (Char, Int32, Int32)报告指定字符在此实例中的第一个匹配项的索引。搜索从指定字符位置开始,...
分类:其他好文   时间:2015-07-14 19:51:14    阅读次数:91
[LeetCode] Longest Substring with At Most Two Distinct Characters
Problem DescriptionGiven a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba...
分类:其他好文   时间:2015-07-14 13:20:40    阅读次数:95
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!