定义函数将字符串首字母大写: 例1:Study hard, improve every day. def toJadenCase(string): return string.title()print(toJadenCase("study hard, improve every day.")) 例2:How can mirrors be real if our eyes aren't real. 第一种:结合capitalize和split: def toJadenCase(strin
如果只是删除尾部的中文,保留数据,可以用以下的简单方式 MySQL as num; +------+ | num | +------+ | +------+ DELIMITER $$ DROP FUNCTION IF EXISTS `Num_char_extract`$$ )CHARSET utf8, flag ) CHARSET utf8 COMMENT '标识 0 提取数字 1 提取字母 2提取数字+字母 3 提取汉字' BEGIN ; ) DEFAULT ''; SET len=CHAR_
Function Setstring(cString:string):string; {提取数字} VAr i:integer; str:string; begin str:=''; For i:=1 to length(cString) do begin if Pos(cString[i],'0123456789.')<=0 then break else Ca