1- strip()方法可以从字符串去除不想要的空白符(role, line_spoken) = each_line.split(":", 1)line_spoken = line_spoken.strip()2- print() BIF的file参数控制将数据发送/保存到哪里print(...) ...
分类:
编程语言 时间:
2014-06-28 23:07:59
阅读次数:
318
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".此题要注意的几个情况是:(1)输入字符串可能含有前缀0和后缀...
分类:
其他好文 时间:
2014-06-28 22:51:26
阅读次数:
261
1:匹配任意字符 [\s\S]* 或者 [\w\W]*
分类:
其他好文 时间:
2014-06-28 21:20:58
阅读次数:
203
由于读写配置文件的次数比较频繁,而且拥有众多的类库,到最后,直接被各种各样的类库烦死。 顺手封一个简单,实用的。主要功能:读写AppSetting读取连接字符串读取自定义配置节using System;using System.Configuration;using System.Web.Conf....
分类:
其他好文 时间:
2014-06-28 21:16:00
阅读次数:
233
SQL截取字符串SUBSTRING返回字符、binary、text或 image表达式的一部分。有关可与该函数一起使用的有效 Microsoft® SQL Server™数据类型的更多信息,请参见数据类型。语法SUBSTRING ( expression , start , le...
分类:
数据库 时间:
2014-06-28 21:15:18
阅读次数:
345
这个问题的意思就是给定两个字符串s1和s2,判断s2是否包含在s1循环移位得到的字符串中。 这个题的最简单的一种思路就是对s1进行循环穷举,对于得到的每种情况,都进行判断s2是否包含在其中。 不过如果s1的字符串很长,那么穷举的时间复杂度是相当高的。因此可以换一种思路。 新的解决办法相当的...
分类:
移动开发 时间:
2014-06-28 20:50:03
阅读次数:
245
#include "stdafx.h"#include #include #include #define TRUE 1#define FALSE 0#define BIG 1#define EQUAL 0#define SMALL -1unsigned int strlenth(ch...
分类:
其他好文 时间:
2014-06-28 20:46:07
阅读次数:
141
解决方法: 方法1: 使用jquery里面的全局函数$.trim()代替原生js方法trim(): $.trim( 你要替换的字符 ); 方法2: Function.prototype.method = function (name, func) { this.prototype[name] = f...
分类:
其他好文 时间:
2014-06-28 20:33:06
阅读次数:
294
1 # -*- coding: utf-8 -*- 2 """ 3 去除字符串两端的空格和字符 4 lstrip()、rstrip()、strip() 5 返回字符串的拷贝 6 """ 7 x = ' aaa ' 8 9 print '|',x.lstrip(),'|',x.rst...
分类:
其他好文 时间:
2014-06-28 20:25:33
阅读次数:
196