473,325 Members | 2,828 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,325 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 20 '05 #1
3 11982
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 20 '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 20 '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 20 '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...
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. *************************** ...
2
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
5
by: DaaaDaaa | last post by:
Hi, Here's what I'd like to do: table (Orders) has fields of Processed, Paid (both of boolean yes|no) etc, I want to return a count of of Total number of Orders, Number of Processed vs. Number...
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.
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...
4
by: Patrick A | last post by:
All, I rely on nested IF statements with multiple conditions heavily, and someone suggested recently writing the statements (and especially reading them months later) would be much easier if I...
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.