如何在Perl中将每个单词的首字母大写? [英] How can I capitalize the first letter of each word in a string in Perl?

查看:611
本文介绍了如何在Perl中将每个单词的首字母大写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在字符串的每个单词中首字母大写的最简单方法是什么?

What is the easiest way to capitalize the first letter in each word of a string?

推荐答案

请参见常见问题解答

我不相信 ucfirst()可以满足OP的问题,以便将其中每个单词的首字母大写一个字符串,而不拆分该字符串,以后再将其加入。

I don't believe ucfirst() satisfies the OP's question to capitalize the first letter of each word in a string without splitting the string and joining it later.

这篇关于如何在Perl中将每个单词的首字母大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆