如何在 Perl 中将字符串中每个单词的第一个字母大写? [英] How can I capitalize the first letter of each word in a string in Perl?
本文介绍了如何在 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屋!
查看全文