Vim中split的使用方法一、作用用split可以显示两个不同的文件;或者同时显示一个文件的两个不同地方;又或者并排比较两个文件。这一切都可以通过分割窗口实现。如下图,左边的两个窗口是mytool.h和mytool.cpp 右边的两个窗口是commonfun.h和commonfun.cpp。同样的...
分类:
系统相关 时间:
2015-05-12 20:50:45
阅读次数:
176
1,邮箱地址只展示部分,只展示@前面部分的第1个及最后一个字符,其它的用*代替:
public static String spliteEmail(String email) {/**传入邮箱地址*/
String newEmail = email.split("@")[0];/**获取到邮箱@前面部分*/
String[] mails = new String[newEmail...
分类:
移动开发 时间:
2015-05-12 18:53:07
阅读次数:
138
判断两个日期之差functionDateDiff(sDate1,sDate2){//sDate1和sDate2的格式为xxxx-xx-xxvaraDate,oDate1,oDate2,iDays;//转换为xx-xx-xxxx格式aDate=sDate1.split("-");oDate1=newD...
分类:
Web程序 时间:
2015-05-12 13:31:28
阅读次数:
130
python中的输入raw_input只能读入一个数,但是有时候需要读入多个数,我们该怎么办呢,读两个数可以使用两个raw_input,但是我们如果需要读取十个数怎么办,不能使用十个raw_nput 吧。
import sys
num1,num2 = map(int,sys.stdin.readline().split())
print num1,num2
如果需要理解上面的代...
分类:
编程语言 时间:
2015-05-12 09:29:22
阅读次数:
162
substr函数 substr函数返回从字符串指定位置开始的一个子串。如果指定了子串的长度,则返回字符串的相应部分。如果指定的长度超出了字符串的实际范围,则返回其实际内容。
格式
substr(字符串,起始位置)
substr(字符串,起始位置,子串长度)
范例
$ awk '{print substr("Santa Claus",7,6)}' filename...
分类:
其他好文 时间:
2015-05-11 21:58:14
阅读次数:
121
--方法0:动态SQL法declare @s varchar(100),@sql varchar(1000)set @s='1,2,3,4,5,6,7,8,9,10'set @sql='select col='''+ replace(@s,',',''' union all select ''')+...
分类:
数据库 时间:
2015-05-11 19:49:19
阅读次数:
214
//字符串是否包含指定字符串String.prototype.Contains = function (str, symbol) { if (symbol) { var arrysb = this.toString().split(','); return arry...
分类:
Web程序 时间:
2015-05-11 17:42:40
阅读次数:
129
1、js多分隔符 分割字符串var username = “zhao,li;wang、liu”;var arr = str.split(/;|;|,|,|、/);括号里面可以写多分割符号,中英文均可,注意每个分割符之间用"|"隔开, 如果是特殊分割符号,如点,加号,必须使用转义字符表示 如str.s...
分类:
编程语言 时间:
2015-05-11 12:29:17
阅读次数:
167
问题:把给定字符串中的关键字用与关键字等长的“*”串代替。Solution:方法1: string 中的 replace 函数方法2:1 def censor(text, word):2 words = text.split(word)3 return ("*"*len(word)...
分类:
编程语言 时间:
2015-05-10 18:38:48
阅读次数:
193
expand#expand[-t]file将[tab]按键转成空格键选项与参数:-t:后面可以接数字。一般来说,一个tab按键可以用8个空格键取代。root@localhost:~/shell#catfile1JohnDagget 341KingRoad PlymouthAliceFord 22EastBroadway Ricahmondroot@localhost:~/shell#expand-t4file1JohnDagget3..
分类:
系统相关 时间:
2015-05-10 17:34:01
阅读次数:
297