14:大小写字母互换 总时间限制: 1000ms 内存限制: 65536kB 描述 把一个字符串中所有出现的大写字母都替换成小写字母,同时把小写字母替换成大写字母. 输入 输入一行:待互换的字符串. 输出 输出一行:完成互换的字符串(字符串长度小于80). 样例输入 If so, you already have a Google Account. You can sign in on the right. 样例输出 iF SO, YOU ALREADY HAVE A gOOGLE aCCO
js 正则 以字母开头必须有 大小写字母数字组成 可以有“@"或 ”.“ var reg = /^[a-zA-Z]{1}(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d_@\.]{6,16}$/; var v = reg.test(str); alert(v); //校验是否全由数字组成 function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)) return false return tr
今天使用split分割"."的时候居然失败了,经过百度发现原来要加转义字符才行. 正确的写法: String test="1.2.3"; String[] s1=test.split("\\."); 结果: 如果不加转义就会分割失败,返回一个空的字符串数组. API中是这样写的: public String[] split(String regex) Splits this string around matches of the given r
代码期间,把代码过程经常用的内容做个珍藏,下边代码是关于C#的String.Split 分割字符串用法详解的代码,应该对码农们有些用途. 1) public string[] Split(params char[] separator)2) public string[] Split(char[] separator, int count)3) public string[] Split(char[] separator, StringSplitOptions options)4) public