| | |
->ToLower() (Mixing letters and numbers)
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
I use this command to check for the Computername wich returns:
When manually rightclicking "My Computer" and check what name I have, it says with lowcase letters:
mycomp-eg03r8f
So it doesn´t return the correct name. It shows Capitals.
But if I do this command instead:
I do get the same computername:
mycomp-eg03r8f
Is it okay to use ->ToLower() when it is a mix with letters and numbers. The function is intelligent and separates letters from numbers ?
Thank you if someone can confirm that...
C++ Syntax (Toggle Plain Text)
SystemInformation::ComputerName->ToString(); //returns: MYCOMP-EG03R8F
When manually rightclicking "My Computer" and check what name I have, it says with lowcase letters:
mycomp-eg03r8f
So it doesn´t return the correct name. It shows Capitals.
But if I do this command instead:
C++ Syntax (Toggle Plain Text)
SystemInformation::ComputerName->ToLower()->ToString();
I do get the same computername:
mycomp-eg03r8f
Is it okay to use ->ToLower() when it is a mix with letters and numbers. The function is intelligent and separates letters from numbers ?
Thank you if someone can confirm that...
•
•
Join Date: Sep 2008
Posts: 1,627
Reputation:
Solved Threads: 205
Judging by the fact that you got the expected output, and not an error, it seems like a safe assumption, doesn't it? If you're concerned about it, run some tests on varying inputs. You'll probably find that it works fine. My guess is that the toLower() function uses the ASCII table to verify that something is a letter and acts appropriately (there are plenty of symbols that aren't letters OR numbers). Also, are you sure you can't look at the function's code yourself, by looking in some standard library?
See also ToLowerInvariant() function:
http://msdn.microsoft.com/en-us/libr...invariant.aspx.
MS recommends ToLowerInvariant for OS identifiers (file names, registry keys etc)...
http://msdn.microsoft.com/en-us/libr...invariant.aspx.
MS recommends ToLowerInvariant for OS identifiers (file names, registry keys etc)...
•
•
Join Date: Oct 2008
Posts: 122
Reputation:
Solved Threads: 6
thank you ArkM, I thought of that perheps can be a scenario that I haven´t thought about. I red about the ToLowerInvariant() and it seems to be the right approach for this purpose.
•
•
•
•
See also ToLowerInvariant() function:
http://msdn.microsoft.com/en-us/libr...invariant.aspx.
MS recommends ToLowerInvariant for OS identifiers (file names, registry keys etc)...
![]() |
Similar Threads
- Letters, numbers and print numbers on the screen (C++)
- Validate A String That Has 2 Letters and Then 6 Numbers (C++)
- Textbox allows letters and numbers only (Visual Basic 4 / 5 / 6)
- random letters/numbers (Visual Basic 4 / 5 / 6)
- 3 letters or numbers com/net/org/info/biz/us -or- YPN invite [wanted] (Websites for Sale)
Other Threads in the C++ Forum
- Previous Thread: Input stream for Point class
- Next Thread: Looking for best practices and naming conventions
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library linker list loop looping loops map math matrix memory microsoft newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings struct temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






