码迷,mamicode.com
首页 >  
搜索关键字:if then else    ( 23991个结果
checkbox全选和反选
$("#CheckBox").click(function(){if(this.checked){$("input[type='CheckBox']").each(function(){this.checked=true;});}else{$("input[type='CheckBox']").ea...
分类:其他好文   时间:2014-11-26 15:52:12    阅读次数:132
限制必须使用微信打开网页
function is_weixin(){ var ua = navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i)=="micromessenger") { return true; } else { ...
分类:微信   时间:2014-11-26 15:51:19    阅读次数:426
字符串中字符右移
var value=0.041991;//04.1991 var value_str; if(String(value).length>8){ value_str=String(value).substring(0,8); }else{ value_str=String(value); } var temp_str = {str: value_str, startIndex: 1...
分类:其他好文   时间:2014-11-26 14:29:38    阅读次数:172
Javascript重要知识点梳理
Javascript重要知识点梳理一.Javascript流程控制js中常用的数据类型var关键字的使用if – else if – elseswitchwhilefor二.Javascript常用函数1. 字符串函数substringindexOflastIndexOfcharAtreplaces...
分类:编程语言   时间:2014-11-26 13:39:14    阅读次数:197
用于调试的printf函数和自定义log函数
#define DEBUG_ENABLE #ifdef DEBUG_ENABLE #define DPRINT(fmt, args...) fprintf(stderr, "[DPRINT...][%s %d] "fmt"\n", __FILE__, __LINE__, ##args); #else #define DPRINT(fmt, ...) #endif...
分类:其他好文   时间:2014-11-26 11:26:15    阅读次数:263
Scala读取文件内容
import scala.io.Source if(args.length>0){ for(line <- Source.fromFile(args(0)).getLines) println(line.length+" "+line) } else Console.err.println("Please enter filename");...
分类:其他好文   时间:2014-11-26 11:24:54    阅读次数:222
bool 类型方法,可以返回其他类型变量
例如: 我在这个需要判定个bool值,因为在不适用指针的情况下,不能确定返回是否为空,而且2个方法过程又完全一样,没必要写2个方法,bool gettimestate(){ if(time>curtime) { return true; }else { return false; }}...
分类:其他好文   时间:2014-11-26 11:04:35    阅读次数:180
判断文字是否为空格 (一个或者多个空格)
// 判断文字是否为空格 (一个或者多个空格) -(BOOL)isEmpty:(NSString *)str{ if (!str) { returntrue; } else { NSCharacterSet *set = [NSCharacterSetwhitespaceA...
分类:其他好文   时间:2014-11-26 10:56:09    阅读次数:175
字符串逆序
#include<iostream>usingnamespacestd;char*reset(char*pa){ if(pa==NULL) { returnNULL; } else { chartemp; char*pch=pa; while(*pch!=‘\0‘) { pch++; } pch--; char*pb=pa; while(pb!=pch) { temp=*pch; *pch=*pb; *pb=temp; pb++; pch--; } }..
分类:其他好文   时间:2014-11-26 06:55:17    阅读次数:151
用一个数代替重复出现的数字
#include<iostream>#include<string.h>usingnamespacestd;voidreplace(int*pa,intn){ int*arr=newint[n]; arr[0]=pa[0]; intk=0; for(inti=0;i<n;i++) { if(arr[k]==pa[i]) continue; else { k++; arr[k]=pa[i]; } } memset(pa,0,n*4); for(inti=0;i&..
分类:其他好文   时间:2014-11-26 06:53:04    阅读次数:124
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!