Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi can anyone answer for this question...


input: hi this is java program

output: Hi This Is Java Program
Posted
Updated 13-Apr-15 0:43am
v4
Comments
Thanks7872 13-Apr-15 6:46am    
Where is the question? What have you tried? Where is the code you have tried till now? Where are you stuck?
tulasi ballada 13-Apr-15 6:50am    
String str="hi how are you";
str = str.substring(0,1).toUpperCase() + str.substring(1).toLowerCase();
System.out.println("print the statement:"+str);
}
}

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.
 
Share this answer
 
C#
string s = "THIS IS MY TEXT RIGHT NOW";
          s = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900