2 Replies - 1912 Views - Last Post: 04 November 2011 - 08:24 PM Rate Topic: -----

#1 Douggie0001  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 03-November 11

Ignoring Case?

Posted 04 November 2011 - 07:56 PM

Hi there,

What is the code for ignoring the case of an entry while checking to see if the entry is correct or not... (i.e. in a flashcard program... given definition, asks for the name) I don't want the case of a character to affect whether the answer is correct or not.

Thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: Ignoring Case?

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1052
  • View blog
  • Posts: 4,077
  • Joined: 02-July 08

Re: Ignoring Case?

Posted 04 November 2011 - 08:11 PM

Simple way:

If someString.ToLower.Equals(someotherString.ToLower) Then 'it does

Was This Post Helpful? 1
  • +
  • -

#3 Tryparse  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 80
  • View blog
  • Posts: 193
  • Joined: 20-April 10

Re: Ignoring Case?

Posted 04 November 2011 - 08:24 PM

You can also use:
If someString.Equals(someOtherString, StringComparison.OrdinalIgnoreCase) Then
    ...

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1