码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
使用委托解决"线程间操作无效: 从不是创建控件“textBox1”的线程访问它" 问题
在winform编程中常遇到此类问题,造成辅助线程无法给控件赋值 1 //定义委托 2 3 private delegate void SetTextCallback(string text); 4 5 6 7 //在给textBox1.text赋值的地方调用以下方法即可 8 9 pri...
分类:编程语言   时间:2015-06-05 15:15:37    阅读次数:171
leetcode 20 -- Valid Parentheses
Valid Parentheses 题目: Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()”...
分类:其他好文   时间:2015-06-05 14:07:10    阅读次数:117
manacher算法的实现
manacher算法的解释见 这里。 //求字符串s中最大回文的长度,要求字符串s不包含字符‘#’ int manacher(const string &s) { if (s.size() <= 1) return s.size(); //往s每个字符之间以及s的首尾都插入‘#’ string str(s.size() * 2 + 1, '#'); for (int...
分类:编程语言   时间:2015-06-05 14:06:24    阅读次数:125
Java7中Switch语句支持String
Java7新特性Swith语句中支持String...
分类:编程语言   时间:2015-06-05 14:04:15    阅读次数:126
iOS中动态计算字符串的长度
在iOS7以下动态算一个string的size的时候可以用sizeWithFont - (CGSize)sizeWithFont:(UIFont *)font   具体应用: CGSize statuseStrSize = [lcsstring sizeWithFont:string.font];   或者 - (CGSize)sizeWithFont:(UIFont *)font co...
分类:移动开发   时间:2015-06-05 14:03:47    阅读次数:239
java万年历
最近一直在努力补因为ACM而耽误的专业课,o(︶︿︶)o 唉 其实我也很喜欢C语言的。 可惜。。只能一步一步来。 Mycalender: import java.awt.*; public class MycalCalender { public static void main(String[] args) { WindowActionEvent win=new WindowActi...
分类:编程语言   时间:2015-06-05 14:02:55    阅读次数:164
JAVA中list,set,数组之间的转换详解
JAVA的list,set,数组之间的转换,主要是使用Apache Jakarta Commons Collections,具体的方法如下:import org.apache.commons.collections.CollectionUtils;String[] strArray = {"aaa"...
分类:编程语言   时间:2015-06-05 13:44:23    阅读次数:152
[Java Swing 大富翁]Java常用的文件、图片、音频 ===通用工具类
/** * 该类用于处理项目资源的工具类 * * 要注意的是:项目资源必须要放到工程目录src下,也可以应用项目外部资源需指明绝对路径 */public class FileUtil { //项目文件必须位于src目录下的下列3个子文件夹之一 private static final String....
分类:编程语言   时间:2015-06-05 13:39:35    阅读次数:136
How to get service execuable path
Some time we need to get specific service path and then do something you want. there are 2 way to get specific service path bellow. private static string GetRegistData(string name) { string registDa...
分类:其他好文   时间:2015-06-05 12:22:03    阅读次数:108
length()代替equals()检验字符串是否为空串
主题 永远也不要使用string.equals(“”)检验一个字符串是空串 最优方案 检验字符串是空串的最好方法是:用length(),这个方法返回字符串中字符的个数,如果字符的个数是0,一定是空串。public boolean isEmpty(String str) { return str.equals(""); //NEVER do this }public boo...
分类:其他好文   时间:2015-06-05 12:21:17    阅读次数:104
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!