码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
Option
Scala提供了Option机制来解决,代码中不断检查null的问题。标准类库中,Option采用样例类实现,有两个样例子类:Some和NoneSome中包装了一个值,可以使用泛型。None中则表示没有值。Option举例: 1 def getProperty(name: String): Opti...
分类:其他好文   时间:2015-05-15 13:32:27    阅读次数:110
String str = "1,2,3,4,5,6" 如何将这个字符串转换成int数组
String str = "1,2,3,4,5,6";string[] strS = str.Split(',');int[] num = new int[strS.Length];int number, i = 0;foreach (var item in strS){if (int.TryPar...
分类:编程语言   时间:2015-05-15 13:31:07    阅读次数:103
leetcode之Length of Last Word
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:其他好文   时间:2015-05-15 13:30:22    阅读次数:116
post 的body json要使用双引号,而不是单引号
string parse error , JS eval error{'name' : 'wade'}http://json.parser.online.fr/string parse ok , JS eval ok{"name" : "wade"}info: Mozilla/5.0 (Macint...
分类:Web程序   时间:2015-05-15 13:29:49    阅读次数:249
l模式匹配--Lua
Lua中我们可能会遇到各种查找替换的相关操作,今天把看到的记录了一下;find:字符串查找gfind:全局字符串查找gsub:全局字符串替换gmatch:返回找到的字符串的迭代器string.gsub(str,pattern,repl,n)根据给定的配对表达式对源字符串str进行配对, 同时返回源字...
分类:其他好文   时间:2015-05-15 13:28:20    阅读次数:231
java十进制转二进制
例如: 5的二进制转换方法为 5除以2 得余数1 然后再用商值2继续除以2 得余数0 然后除尽了商值为1 所以 最后得到二进制值为 101 public static void main(String[] args)     {           StringBuffer sbf = toBin(10);           String str=sbf.reverse().to...
分类:编程语言   时间:2015-05-15 12:10:39    阅读次数:139
Python特殊语法:filter、map、reduce、lambda
Python内置了一些非常有趣但非常有用的函数,充分体现了Python的语言魅力![1] filter(function, sequence)对sequence中的item依次执行function(item),将执行结果为True的item组成一个List/String/Tuple(取决于sequence的类型)返回:>>> def f(x): return x % 2 != 0 and x % 3...
分类:编程语言   时间:2015-05-15 12:09:36    阅读次数:146
判断某个apk是否已经安装
/**      * 判断apk是否已经安装      * @param uri  apk包名      * @return      */     private boolean isAppInstalled(String uri){     PackageManager pm = getPackageManager();     boolean installed =false;...
分类:其他好文   时间:2015-05-15 10:49:11    阅读次数:131
【面试题】JAVA 一个线程依赖另外一个线程的结果
public class Main { public static class MyCallable implements Callable{ public Integer call() throws Exception { return 1; } } public static void main(String[] args) { MyCallable callable...
分类:编程语言   时间:2015-05-15 10:46:57    阅读次数:123
获取java程序运行时内存信息
由于最近想自己动手测试一下String和StringBuffer的效率问题,需要获取程序运行时的内存占中信息,于是上网查了一下,根据查到的资料写了个程序,发现结果有问题,才发现查到的资料是错误的.所以在这里跟大家分享一下获取内存占用的正确方法...
分类:编程语言   时间:2015-05-15 10:45:40    阅读次数:167
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!