jQuery中$符号的作用作为jQuery包装器,利用选择器来选择DOM元素(这个也是最强大的功能)例如:$("table tr:nth-child(even)")实用工具函数,作为几个通用的实用工具函数的命名空间的前缀例如:$.trim(someString)文档就绪处理程序,相当于$(docum...
分类:
Web程序 时间:
2015-05-07 16:13:27
阅读次数:
194
function trim(str){ //创建空格对象 var space = new String(" "); /* str = trimLeft(str,space); str = trimRight(str,space); */ return tri...
分类:
Web程序 时间:
2015-05-06 21:08:25
阅读次数:
242
1. select 默认选中: 2. jquery 去除空格:$.trim(" 你好,开源中国社区 ");
分类:
Web程序 时间:
2015-05-06 19:34:43
阅读次数:
180
$text = ' ... Hello ...--- '$text.Trim(" .-`t`n`r")结果只显示:HelloFrom:http://powershell.com/cs/blogs/tips/archive/2015/04/30/removing-whitespace-...
分类:
其他好文 时间:
2015-05-05 19:12:39
阅读次数:
106
在git中我们提交项目的时候有很多东西是不需要进行版本管理的,因此我们需要忽略掉。虽然在github2.0的windows客户端提供了工具,但是这个工具并不是想象中的那么好用。在上面点右键出现的Discard changes只能忽略掉一个文件,如果想忽略掉一个文件夹里的所有文件,这样点下去还不累死?...
分类:
其他好文 时间:
2015-05-05 16:07:41
阅读次数:
157
public final static String filterSQLInjection(String s) { ??? if (s == null || "".equals(s)) { ??????? return ""; ??? } ??? try { ??????? s = s.trim().replaceAll("</?[s,S][c,...
分类:
数据库 时间:
2015-05-04 18:26:03
阅读次数:
151
1.?mb_strlen(); 统计有多少个字1.strlen($s) 统计有多少字节 utf8中一个汉字为3个字节 $s='中国China'; echo strlen($s);//统计字节个数 2.str_split($ss,3)三个为一组,对中文支持不好3.trim($a); 清除左边或者右边的...
分类:
Web程序 时间:
2015-05-03 15:55:17
阅读次数:
161
#include #include using namespace std;namespace strtool{string trim(const string& str){ string::size_type pos = str.find_first_not_of(' '); if (...
分类:
编程语言 时间:
2015-04-29 19:18:09
阅读次数:
191
第一种方法,使用正则表达式: function findNum($str=''){ $str=trim($str); if(empty($str)){return '';} $reg='/(\d{3}(\.\d+)?)/is';//匹配数字的正则表达式 preg_match_all($reg,$st...
分类:
Web程序 时间:
2015-04-29 00:18:46
阅读次数:
201
1.编码string state=Server.UrlEncode(stateName.Text.Trim());Response.Redirect("aaa.aspx?state="+state+"");2.解码(aaa.aspx)string state= Server.UrlDecode(Re...
分类:
Web程序 时间:
2015-04-28 11:24:34
阅读次数:
128