thorner
asked on
String Capitilization
How can I capitilize the first character of the first word in a sentence? I have random numbers working with string arrays making sentences. I can't figure out how to capitilize the first letter of the first word? Here's my code to print the strings:
g.drawString( article[a] + " " + noun[b] + " " + verb[c] + " " + preposition[d] + " " + article[e]
+ " " + noun[f] + ".", 25, yPos );
g.drawString( article[a] + " " + noun[b] + " " + verb[c] + " " + preposition[d] + " " + article[e]
+ " " + noun[f] + ".", 25, yPos );
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. Both of these methods worked, however I liked the second one better because it was a shorter alternative to the first.
imladris,
Yes it would :-) Looks like I still have some C++ vices in my coding that keep me looking for increses execution time tricks.
In Java your solution is in fact better.
Yes it would :-) Looks like I still have some C++ vices in my coding that keep me looking for increses execution time tricks.
In Java your solution is in fact better.
g.drawString(article[a].su