473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Capitalization, First letter with string class

thav
6
I have a question which may sound stupid. I already searched the forums and I didn't understand it well.

But is there a way to just capitalize the first letter of a string just using the string class.

I know you can create a string.

and then you use a .ToUpper() or a .ToLower() to get all of the string one format. Is there an easier way where on first letter is capitilized?
Apr 24 '07 #1
1 2177
Ganon11
3,652 Expert 2GB
You can access the first character and use the toupper() function to make it uppercase. To access a character in a string, use myString[n], where n is the number of the character you want. toupper() accepts one character argument and returns its uppercase equivalent (if a letter) or the same character (if a number, symbol, etc.)
Apr 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: icrash2 | last post by:
Hi, I'm using PHP to submit form input to MySQL and need a way to capitalize the first character for certain fields. Does anyone know of some way to achieve this? Much appreciated
12
by: Alan J. Flavell | last post by:
OK, today's email brought a comment from a reader, pointing out something that I'd long since noticed myself but hadn't done anything about it. On my pages, I've got a first-letter style on...
8
by: Ray | last post by:
Hello guys, OK, I've been reading some more about Python. There are some things about Python exception that I haven't been able to grasp: 1. This is a small thing, but why is object spelled...
6
by: Corepaul | last post by:
I am new to Access 2000. My operating system is Windows 2000. In the early stage of development I noticed something weird. On my form, I have a Command Button named "btnAlbumUp". The first time...
5
by: Aaron | last post by:
How do you detect a string that is all capitalized? ie. string s = "MY NAME IS"; return true; string s = "My Name is"; return false;
7
by: Rich Grise | last post by:
OK, I don't know if this is Off-Topic for the group(s), because "QT" isn't "Pure C++", and Slackware is a distro, but those guys are sharp. :-) And I've crossposted to sci.electroncs.design because...
2
by: setabery | last post by:
When entering a value to a field, is there a way to make only the first letter upper case without using the Shift Key? For example, entering a name.
3
by: majorecono | last post by:
What I'm bad at is the dialog box part. This is the code Ive come up with... if you see a way to improve what im thinkng of.... post it please. Program should.... 1. Ask user to type in a...
2
by: whodgson | last post by:
The following code accepts a string from the user and swaps the first and last letters in each word. It prints out the original string incorrectly by dropping off the first letter of the first word....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.