这两个函数除了调用对象以及参数不同之外,<javascript高级程序设计>中对exec描述比较详细,对match只是说返回数组跟exec一样.书中并没有说只说了正则在非全局模式下的情况,但是其实在正则全局模式下则有很大区别. 一.非全局模式下 在非全局模式下,两种方法返回结果相同,我们以match为例. 我们首先来看代码 var str="cat,bat,sat"; var pattern=/.at/; var matches=str.match(pattern); co
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法capitalize() #capitalize() #说明:将字符串的第一个字母变成大写,其他字母变小写. ''' capitalize(...) S.capitalize() -> string Return a copy of the string S with only its first character capitalized. ''' #案例 str='xiaoden
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法isupper() #http://www.runoob.com/python/att-string-isupper.html #isupper() #说明:检测字符串中所有的字母是否都为大写 ''' isupper(...) S.isupper() -> bool Return True if all cased characters in S are uppercase and