public void deletefile(String delpath) throws Exception { try { File file = new File(delpath); // 当且仅当此抽象路径名表示的文件存在且 是一个目...
分类:
编程语言 时间:
2015-02-05 10:58:03
阅读次数:
120
package com.winwill.nio;
/**
* @author qifuguang
* @date 15-2-4 下午2:07
*/
public class TimeServerMain {
public static void main(String[] args) throws Exception {
// 启动时间服务器
new...
分类:
编程语言 时间:
2015-02-05 09:38:57
阅读次数:
149
if( third_name.find('*')!=string::npos || third_name.find('@')!=string::npos ){
printf("third_name[%s] is a email or a mobilenum", third_name.c_str());
return -1;
}
查到一个string 字符串中知否有 * 字符,或者有 @ 字符...
分类:
编程语言 时间:
2015-02-05 09:38:55
阅读次数:
107
For example,
a = "11"
b = "1"
Return "100".
这题的做法和前面一题plus one 一样,区别在于需要将两个string先相加,再判断是否要进位。
直接上代码吧。
class Solution:
# @param a, a string
# @param b, a string
# @return a string
...
分类:
编程语言 时间:
2015-02-05 09:36:04
阅读次数:
153
OGNL概述
Object-Graph Navigation Language,对象图导航语言
1、能够访问对象的方法,如list.size()
2、能够访问静态属性与静态方法,需要在类名前加上@,如@java.lang.Math@PI,@java.lang.String@format('foo %s','bar')
3、支持赋值操作和表达式串联,如赋值#value=5
4、访问OG...
分类:
其他好文 时间:
2015-02-05 09:33:23
阅读次数:
169
JSP:Action:添加//格式化数字显示 public String formatDouble(double s){ DecimalFormat fmt = new DecimalFormat("\u00A4##0.00"); return fmt.format(s); }JAVA String...
分类:
其他好文 时间:
2015-02-05 09:28:14
阅读次数:
211
tr/ / / 替换操作符不支持正则表达式 也不具备双引号替换能力m/ / s/ / / 都支持正则表达式,并且可以提供或限制双引号替换能力$string = "25abc8";$string =~ /abc(?=[0-9])/;(?=pattern) 前看声明,如果正则表达式在下一次匹配 patt...
分类:
其他好文 时间:
2015-02-05 09:25:52
阅读次数:
133
// 定义函数时 需要加一个 func关键字 sayHello 为函数名 括号里的为参数(参数名: 参数类型) -> 指的是返回值 {}大括号里面的表示函数体func sayHello(name:String, number:Int)->String { return name }sayHell.....
分类:
编程语言 时间:
2015-02-05 09:23:51
阅读次数:
216
一 NSString/NSMutableString字符串
1 NSString
NSString* s1 = @"string";
//NSString* s2 = [[NSString alloc] initWithFormat(@"%d is one",1)];
NSString* s2 = [NSString stringWithFormat(@"%d is one",1)];
/...
分类:
移动开发 时间:
2015-02-05 07:03:55
阅读次数:
188
Compare two strings A and B, determine whether A contains all of the characters in B.The characters in string A and B are all Upper Case letters.Examp...
分类:
其他好文 时间:
2015-02-05 07:03:49
阅读次数:
311