自己在看到这个问题的时候,想到的是用ASCII码来处理,没往万能的正则上去想。好吧,下面来看看答案:答案1: 代码如下 复制代码 $str = 'OpenAPI';$length = mb_strlen($str);$new = '';for($i = 0; $i = 65 && $num = 97...
分类:
Web程序 时间:
2014-09-26 20:33:18
阅读次数:
210
Delphi中TStringList类常用属性方法详解//TStringList 常用方法与属性:varList: TStringList;i:Integer;beginList := TStringList.Create;List.Add('Strings1');{添加}List.Add('Str...
分类:
其他好文 时间:
2014-09-26 19:02:58
阅读次数:
191
$str="MaryHadALittleLambandSheLOVEDItSo";stringstrtolower(string$str)—将字符串转化为小写(所有字符) //打印maryhadalittlelambandsheloveditso 返回值:返回转换后的字符串strings...
分类:
其他好文 时间:
2014-09-26 18:17:18
阅读次数:
315
Java自定义实现String转换为int 的简单实现!public class StringToInt { public static int stringToInt (String str){ char[] num = str.toCharArray();//得到各个...
分类:
编程语言 时间:
2014-09-26 14:10:08
阅读次数:
154
1,判断字符串是否是这样组成的,第一个必须是字母,后面可以是字母、数字、下划线,总长度为5-20var reg = /^[a-zA-Z][a-zA-Z_0-9]{4,19}$/;reg.test("a1a__a1a__a1a__a1a__");2,截取字符串abcdefg的efgvar str = ...
分类:
Web程序 时间:
2014-09-26 13:50:18
阅读次数:
196
//$str = 'fff&sdf你是sdf好fdf啊b歌hello中world';$str = 'd你b_fff是好啊歌中潺潺 ';echo chineselength($str)."-----";function chineselength($str){ $s=iconv("utf-8","gb...
分类:
其他好文 时间:
2014-09-26 13:47:08
阅读次数:
141
算法思想:http://www.cnblogs.com/lichen782/p/leetcode_minimum_window_substring_3.html 1 public class Solution { 2 public String minWindow(String S, Str...
最近做程序,时不时需要自己去手动将sql语句直接写入到Java代码中,写入sql语句时,需要注意几个小问题。 先看我之前写的几句简单的sql语句,自以为没有问题,但是编译直接报错。1 String str = "insert into XXX(a,b,c) values ('"a.getA()...
分类:
数据库 时间:
2014-09-26 12:53:08
阅读次数:
197
TheLove-LetterMystery#include<cmath>
#include<cstdio>
#include<vector>
#include<iostream>
#include<algorithm>
#include<string>
usingnamespacestd;
intmain(){
intT;
cin>>T;
stringstr;
getline(cin,str);
while(T--)
{..
分类:
其他好文 时间:
2014-09-26 00:39:28
阅读次数:
253
Python中sequence主要包含存储单个元素序列和两个元素对的序列,str就是一个字符容器。
单元素序列主要有以下类型:
bytearray: 字节数组,通过built-in 函数bytearray()创建
xrange:由函数xrange(n)/xrange(start, stop, step)创建,但不支持容器上的切片,连接,复制, in/not in 判断,mi...
分类:
编程语言 时间:
2014-09-25 22:16:17
阅读次数:
445