473,405 Members | 2,344 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,405 software developers and data experts.

how to case select with case-insensitive string ?

Tee
Hi,

How to case select with case-insensitive ?

eg:

Select Case Textbox1.Text
Case "Hello" -- ( this will include "Hello", "HELLO", "hElLo" etc etc. )

Case "Bye"

End Select

anyone know how ?
Thanks.
Nov 18 '05 #1
3 1320
Try this syntax:

Select Case Textbox1.Text.ToLower()
Case "hello"

Case "bye"

End Select

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Tee" <th*@streamyx.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

How to case select with case-insensitive ?

eg:

Select Case Textbox1.Text
Case "Hello" -- ( this will include "Hello", "HELLO", "hElLo" etc etc. )
Case "Bye"

End Select

anyone know how ?
Thanks.

Nov 18 '05 #2
Hi,

Add Option Compare Text to the top of your file. Simple console app
example.

Option Compare Text

Module Module1

Sub Main()
Dim strOne As String = "hello"
Dim strTwo As String = "HELLO"

Console.WriteLine(strOne = strTwo)
End Sub

End Module
Ken
-------------

"Tee" <th*@streamyx.com> wrote in message
news:#x**************@TK2MSFTNGP10.phx.gbl:
Hi,

How to case select with case-insensitive ?

eg:

Select Case Textbox1.Text
Case "Hello" -- ( this will include "Hello", "HELLO", "hElLo" etc etc. )

Case "Bye"

End Select

anyone know how ?
Thanks.


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.3 - Release Date: 6/18/2004
Nov 18 '05 #3
* "Tee" <th*@streamyx.com> scripsit:
How to case select with case-insensitive ?

eg:

Select Case Textbox1.Text
Case "Hello" -- ( this will include "Hello", "HELLO", "hElLo" etc etc. )

Case "Bye"

End Select

anyone know how ?


In the project properties, set "Option Compare" to "Text", or on
per-file basis you can add 'Option Compare Text' in the declaration area
of your file.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 18 '05 #4

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

Similar topics

17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
9
by: Kevin | last post by:
Hi, I am getting a syntax error Microsoft VBScript compilation error '800a03ea' Syntax error On the code below. The error references the "End Select" line Can anyone help me with what I am...
1
by: ST | last post by:
Hi, I'm trying to debug someone else's code, and I'm going thru this Select Case statement. I'm having problems with the "OTHER" case...in that when the first line of the case is false, it jumps...
8
by: Penny | last post by:
Hi all, My browser throws this Select Case block back at me pointing out a syntax error on the line: 'Case < 251', between the word 'Case' and the '<' symbol. *************************** ...
4
by: Terencetrent | last post by:
I having been using Access '97/2002 for about 4 years now and have never really had the need or the time to learn visual basic. Well, I think the time has finally come. I need help with Visual...
10
by: MLH | last post by:
Suppose the following... Dim A as Date A=#7/24/2005# I wish to compare value of A against 2 other values: 1) 8/1/2005 2) 9/1/2005 Which is better and why... First:
7
by: Lauren Quantrell | last post by:
Is there any speed/resource advantage/disadvantage in using Select Case x Case 1 Case 2 etc. many more cases... End Select VS.
8
by: Bob Day | last post by:
using vs 2003 ... This works fine Select Case 350 Case 300 To 399 Stop End Select This fails with no warning Select Case 520
5
by: PJ6 | last post by:
Select Case o.GetType Case = GetType(SomeRandomTypeName) '... End Select Why doesn't this work? Can I make it work or am I stuck with ElseIf for a long list? Paul
1
by: microsoft.public.dotnet.languages.vb | last post by:
Hi All, I wanted to know whether this is possible to use multiple variables to use in the select case statement such as follows: select case dWarrExpDateMonth, dRetailDateMonth case...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.