Solved

Case Insensitive

Posted on 1998-11-15
3
206 Views
Last Modified: 2010-03-04
How do I make something case insensitive?
Say, if

$variable1 = "Hello";
$variable2 = "HELLO";

How can I tell if variable1 and variable 2 are the same, even though one is totally capitalized, and the other isn't?

Thanks,
Mark
0
Comment
Question by:eversoslightly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1206222
if (lc($variable1) eq lc($variable2)) {
  # I don't know is the "correct" way of doing it, but it works...
}

Martin
0
 
LVL 1

Author Comment

by:eversoslightly
ID: 1206223
Thanks!  Works great - just answer the question, and I'll give ya the points.
0
 
LVL 4

Accepted Solution

by:
martinag earned 10 total points
ID: 1206224
if (lc($variable1) eq lc($variable2)) {
  # I don't know is the "correct" way of doing it, but it works...
}

Martin
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question