simplistic question: changing a character to caps?

C++, C#, Java, PHP, ect...
Post Reply
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

simplistic question: changing a character to caps?

Post by Callan S. »

I'd like to show the players user name with a capital during combat description. I'm sure there's some PHP code that can grab the first letter, make an upper case version of it, then I'll take the first letter and the rest of the string and put it into a new string. Sorry for the simple question!
Edit: Actually this should probably go in coding - I'm never sure of the right category to put it in.
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
Jony
Posts: 26
Joined: Tue May 11, 2010 3:34 pm

Re: simplistic question: changing a character to caps?

Post by Jony »

This is what you might be looking for.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: simplistic question: changing a character to caps?

Post by Jackolantern »

Yep, that is the best way to do it there. Luckily PHP includes a single function to do just that, so no need to worry about the other steps.
The indelible lord of tl;dr
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: simplistic question: changing a character to caps?

Post by Callan S. »

So your saying I should uc it!? ;)

Thanks Jony! Kind of handy it had a function that did exactly what I needed!
Fight Cycle : My latest Browser game WIP
Driftwurld : My Browser Game WIP
Philosopher Gamer : My Blog
Post Reply

Return to “Coding”