473,387 Members | 1,596 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,387 software developers and data experts.

check and convert lower character to upper character

How can I check in c++ string if a character is lower or upper?
Exist a function in c++ to convert string to upper characters?
Thanks in advance.
Nov 17 '07 #1
3 3443
On Nov 17, 11:27 am, alessio211...@yahoo.it wrote:
How can I check in c++ string if a character is lower or upper?
Exist a function in c++ to convert string to upper characters?

Thanks in advance.
The isupper(), islower(), toupper(), and tolower() functions should
handle this. You will need to also include the cctype header in your
code.
Nov 17 '07 #2
oogie wrote:
The isupper(), islower(), toupper(), and tolower() functions should
handle this.
Note that they might not handle correctly characters outside the ASCII
range (such as ä, ö, etc).
Nov 17 '07 #3
On Nov 18, 12:20 am, Juha Nieminen <nos...@thanks.invalidwrote:
oogie wrote:
The isupper(), islower(), toupper(), and tolower() functions should
handle this.
Note that they might not handle correctly characters outside the ASCII
range (such as ä, ö, etc).
It's locale specific.

Note, on the other hand, that you cannot reliably pass a char to
the isupper() et al. functions in <cctypewithout risking
undefined behavior. For this, you need the functions in
std::locale::ctype<char(which is probably the better way to do
it anyway, although it can be awfully verbose).

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Nov 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner,...
22
by: DJ | last post by:
Can someone tell me the library call that converts strings to lower case or retrns a new string that is lower case of the original, thanks im using <string> David
18
by: didgerman | last post by:
Chaps, I need to properly format the case of a struct. Can I just hit it with tolower, and then 'while (string ==' ') pos++; string=toupper(string); to add in the higher case for the start of...
6
by: Sunit Joshi | last post by:
I have a 16-bit port no. This address information is broken into 8-bit fields and the value of each field is transmitted as a decimal number (in character string representation , eg: "177,147") ...
4
by: Chris | last post by:
Hi, How can I programatically set Upper, Lower and Normal case on a label or text box controls? Thanks
8
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single ,...
2
by: shuisheng | last post by:
Dear All, Assume I have a class for a cuboid domain. The domain is defined by the cuboid's lower corner, such as (0, 0, 0), and upper corner, such as (1, 1, 1). The upper corner should be always...
13
by: RishiD | last post by:
Hi, For some reason I am blanking this Friday morning. I have a class constructor call Point as shown below. Trying to figure out how I can make the arguments passed in all upper case before I...
14
by: fniles | last post by:
In VB.NET 2005 can I check if a letter in a string is upper case or lower case ? For example: I have the following 2 lines: NQ,Z2003,11/11/2003,1416.5,1420,1402,1411.5...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.