#Ucfirst

[Go] 第一个单词首字母变大写:Ucfirst(),第一个单词首字母变小写:Lcfirst()

import("unicode")funcUcfirst(strstring)string{fori,v:=rangestr{returnstring(unicode.ToUpper(v))+str[i+1:]}return""}funcLcfirst(strstring)string{fori,v:=rangestr...

PHP ucfirst() 函数

把"hello"的首字符转换为大写:<?phpechoucfirst("helloworld!");?>运行实例»ucfirst()函数把字符串中的首字符转换为大写。相关函数:lcfirst() -把字符串中的首字符转换为小写ucwords() -把字符串中每个单词的首字符转...
代码星球 代码星球·2020-08-04