每个单词的第一个字母应该是给定字符串中的大写字母 [英] the first letter of every word should be capital in a given string

查看:87
本文介绍了每个单词的第一个字母应该是给定字符串中的大写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以回答这个问题...





输入:嗨这是java程序



输出:嗨这是Java程序

hi can anyone answer for this question...


input: hi this is java program

output: Hi This Is Java Program

推荐答案

谷歌是你的朋友:好好经常拜访他。他可以比在这里发布问题更快地回答问题...



非常快速的搜索提供超过300,000次点击: Google将字符串java中的每个单词大写 [ ^ ]



将来,请尝试自己做至少基础研究,不要浪费你的时间或我们的时间。
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search gave over 300,000 hits: Google "capitalise each word in string java"[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.


string s = "THIS IS MY TEXT RIGHT NOW";
          s = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());


这篇关于每个单词的第一个字母应该是给定字符串中的大写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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