Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to case select with case-insensitive string ?

Reply
Thread Tools

how to case select with case-insensitive string ?

 
 
Tee
Guest
Posts: n/a
 
      06-23-2004
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.


 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      06-23-2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      06-23-2004
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" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed):
> 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


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      06-23-2004
* "Tee" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to check a String contains another String,case-insensitively? tomaszewski.p Java 4 09-12-2008 05:40 PM
Re: How to check a String contains another String, case-insensitively? Knute Johnson Java 0 09-11-2008 07:59 PM
Dim inside Select case executes in any case? aa ASP General 14 04-24-2007 06:24 AM
"Case 1 To 5" in Select case, giving Error!!. Why? Lakshmi Narayanan.R ASP General 10 03-04-2005 01:13 AM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments