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

Lowercase lettter in a string ?

What is the fastest way to tell in string contains lower case letters?
Nov 16 '05 #1
4 7601
Hi, Marlon,

fastest in complexity or in writing?

You can use simply
if (mystring.ToLower() != mystring)

If you need fastest in execution then I don't have simple answer. It depends
on strings - how big they are and where from come

HTH
Alex

"Marlon R" <mr***@exhibitworks.com> wrote in message
news:eN**************@TK2MSFTNGP11.phx.gbl...
What is the fastest way to tell in string contains lower case letters?

Nov 16 '05 #2
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:eh**************@TK2MSFTNGP09.phx.gbl...
You can use simply
if (mystring.ToLower() != mystring)


er.umm... if (mystring.ToUpper() != mystring)

(Imagine if mystring was all lower case to begin with.....)
--
Truth,
James Curran
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
(note new day job!)
Nov 16 '05 #3
Right,
good that someone remarked!

Rgds
Alex
"James Curran" <Ja*********@mvps.org> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl...
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:eh**************@TK2MSFTNGP09.phx.gbl...
You can use simply
if (mystring.ToLower() != mystring)


er.umm... if (mystring.ToUpper() != mystring)

(Imagine if mystring was all lower case to begin with.....)
--
Truth,
James Curran
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
(note new day job!)

Nov 16 '05 #4

"Marlon R" <mr***@exhibitworks.com> wrote in message
news:eN**************@TK2MSFTNGP11.phx.gbl...
What is the fastest way to tell in string contains lower case letters?


Not quite sure I understand your question but if you want to tell if a
string contains "any" lowercase letters then you can use regex.

if(Regex.IsMatch("ABsF", "[a-z]", RegexOptions.Compiled |
RegexOptions.IgnorePatternWhitespace))
{
MessageBox.Show("Match");
}

which will show "Match" if "any" of the characters in the string are
lowercase.

HTH
JB
Nov 16 '05 #5

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

Similar topics

37
by: Zombie | last post by:
Hi, what is the correct way of converting contents of a <string> to lowercase? There are no methods of <string> class to do this so I fallback on strlwr(). But the c_str() method returns a const...
1
by: The_Kingpin | last post by:
Hi all, I need to make a function that convert a string into a certain format. Here what are the restriction: -The first letter of the first and last name must be uppercase. -If a first name...
2
by: Paul | last post by:
Hi, As most people who use the FileSystemWatcher know, it returns lowercase text for some strange reason. I know there's a workaround for the lowercase the FileSystemWatcher returns by by passing...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using str_replace() to strip out such content, but then one ends...
4
by: Jim Langston | last post by:
Is there any builtin lowercase std::string compare? Right now I'm doing this: if ( _stricmp( AmmoTypeText.c_str(), "GunBullet" ) == 0 ) AmmoType = Item_Ammo_GunBullet; Is there anything the...
22
by: federico_bertola | last post by:
Hi everybody, I have an array of chars that I want to make all lower int Scan(char Search) { char *cPtr; cPtr = strtok (Search," -,."); while (cPtr != NULL) {
15
by: Optimus | last post by:
I would like to know if there is a encryption algorithm that returns only lowercase encrypted string. Thanks in advance.
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...
9
by: Bob | last post by:
Hi, Maybe this problem has already been mentionned, but I am new to this group, so here we go. $string = "This is for ABC only" $new = (eregi_replace('ABC','<b>ABC</b>',$string)); print...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.