如何将句子中每个单词的首字母大写? (类似于 CSS text-transform capitalize)
谢谢。 乌力
最佳答案
使用正则表达式替换:
var str:String = "the quick brown fox jumped over the lazy dog.";
str = str.replace(/(^[a-z]|\s[a-z])/g, function():String{ return arguments[1].toUpperCase(); });
关于actionscript-3 - AS3 - 将句子中的每个单词大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13541058/