摘要: 字符串中字符大小写的变换:* S.lower() #小写* S.upper() #大写* S.swapcase() #大小写互换* S.capitalize() #首字母大写* String.capwords(S) #这是模块中的方法。它把S用split()函数分开,然后用capitalize()把首字母变成大写,最后用join()合并到一起* S.title() #只有首字母大写,其余为小写,模块中没有这个方法字符串在输出时的对齐:* S.ljust(width,[fillchar]) #输出width个字符,S左对齐,不足部分用fillchar填充,默认 的为空格。*... 阅读全文
posted @ 2013-12-26 18:41 朋友博客集 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Python 中的re 模块正则表达式就个人而言,主要用它来做一些复杂字符串分析,提取想要的信息学习原则:够用就行,需要的时候在深入现总结如下:正则表达式中特殊的符号:“.” 表任意字符“^ ” 表string起始“$” 表string 结束“*” “+” “?” 跟在字符后面表示,0个——多个, 1个——多个, 0个或者1个*?, +?, ?? 符合条件的情况下,匹配的尽可能少//限制*,+,?匹配的贪婪性{m} 匹配此前的字符,重复m次{m,n} m到n次,m,n可以省略举个例子 ‘a.*b’ 表示a开始,b结束的任意字符串a{5} 匹配连续5个a[] 表一系列字符 [abcd] 表a,b 阅读全文
posted @ 2013-12-26 18:38 朋友博客集 阅读(142) 评论(0) 推荐(0) 编辑
摘要: >#-*-coding:utf-8-*-import datetime, calendardef getYesterday(): today=datetime.date.today() oneday=datetime.timedelta(days=1) yesterday=today-oneday return yesterday def getToday(): return datetime.date.today() #获取给定参数的前几天的日期,返回一个listdef getDaysByNum(num): today=datetime.date.toda... 阅读全文
posted @ 2013-12-26 18:37 朋友博客集 阅读(475) 评论(0) 推荐(0) 编辑
摘要: >01.int(x [,base ]) 将x转换为一个整数 02.long(x [,base ]) 将x转换为一个长整数 03.float(x ) 将x转换到一个浮点数 04.complex(real [,imag ]) 创建一个复数 05.str(x ) 将对象 x 转换为字符串 06.repr(x ) 将对象 x 转换为表达式字符串 07.eval(str ) 用来计算在字符串中的有效Python表达式,并返回一个对象 ... 阅读全文
posted @ 2013-12-26 18:36 朋友博客集 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 用CSS设置Select样式 5 26 27 28 29 38 39 40 阅读全文
posted @ 2013-12-26 14:20 朋友博客集 阅读(2035) 评论(0) 推荐(0) 编辑
摘要: 1,设置line-height等于div的高度2,div里面增加一个table,tr,td 设置td的样式 阅读全文
posted @ 2013-12-26 14:15 朋友博客集 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2013-12-26 13:54 朋友博客集 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 定义String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, "");}String.prototype.LTrim = function() { return this.replace(/(^\s*)/g, "");}String.prototype.Rtrim = function() { return this.replace(/(\s*$)/g, "");}使用s=" 123123asdfasdf "alert(s) 阅读全文
posted @ 2013-12-26 13:53 朋友博客集 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1 Dim FDictionary As New Dictionary(Of Integer, Integer) 2 3 FDictionary.Add(3001, 1) 4 5 FDictionary.Add(3002, 5) 6 7 FDictionary.Add(3003, 3) 8 9 FDictionary.Add(4003, 2)10 11 FDictionary.Add(5003, 3)12 13 14 15 Dim SortedItems = From Ke... 阅读全文
posted @ 2013-12-26 13:50 朋友博客集 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Cint(x)将数值型数据x的小数部分四舍五入取整Int(x)取小于等于x的最大整数Fix(x)将数值x的小数部分舍去。例:Print Int(4.6), Int(-4.6) 打印 4 -5Print Fix(-4.6), Fix(4.6) 打印 -4 4Print CInt(4.6), CInt(-4.3) 打印 5 -4对Cint函数要注意的是:在.5处进位时要注意整数部分的值,如是偶数不进位,奇数则进位。如Print CInt(4.5), CInt(5.5) 打印 4 6 阅读全文
posted @ 2013-12-26 13:49 朋友博客集 阅读(759) 评论(0) 推荐(0) 编辑