function pySegSort(arr, empty) { if (!String.prototype.localeCompare) return null; var letters = "*ABCDEFGHJKLMNOPQRSTWXYZ".split(''); var zh = "阿八嚓哒妸发旮哈讥咔垃痳拏噢妑七呥扨它穵夕丫帀".split('')...
str.capitalize! → str or nilModifiesstrby converting the first character to uppercase and the remainder to lowercase. Returnsnilif no changes are made. Note: case conversion is effective only...
每单词首字大写,其他小写。如blue idea转换为Blue Idea,BLUE IDEA也转换为Blue Idea
cloeft的正则: /\b(\w)|\s(\w)/g
所谓“首字母”包括两种情况:第一种是边界(开头)的单词字符,一种是空格之后的新单词的第一个字母。测试代码如下: <script type="text/javascript">
function r
import com.sun.xml.internal.ws.util.StringUtils;public class Test { public static void main(String[] args) { String str = "asbc"; str = StringUtils.capitalize(str); System.out.println(str); System