actionscript-3 - AS3 - 将句子中的每个单词大写

标签 actionscript-3

如何将句子中每个单词的首字母大写? (类似于 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/

相关文章:

actionscript-3 - Robotlegs 2 与 PureMVC 相比的缺点

actionscript-3 - 使用 as3httpclientlib 从 as3 air 项目到 web 服务的 https

actionscript-3 - Adobe Air AS3,配置窗口,profiler 建议库代码

xml - 从值对象填充和访问数据

actionscript-3 - 在变量声明或构造函数中实例化类

android - [AS3][Air for Android] 获取流式麦克风输入?

android - 在移动设备上存储信息并唯一标识,在 Air 中跨平台

flash - 削减嵌入式视频的声音

c# - 使用 C# 的 Actionscript 3.0 网络编程

actionscript-3 - AIR企业部署和更新