Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8274009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:37:09+00:00 2026-06-08T07:37:09+00:00

Im wondering if there is a way in .net to compare strings when they

  • 0

Im wondering if there is a way in .net to compare strings when they contain letters such as é.

Example: I’m searching a string that says José. I want to return true when I check to see if the string José contains “e” (without the accute)

Is there a way to do this without comparing all the variations of different characters manually?

any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:37:10+00:00Added an answer on June 8, 2026 at 7:37 am

    You will first have to define diacritics somehow. Do not list all characters; instead, use Unicode categories. There are just two or three kinds of combining marks to think about.

    For example, you might only want to detect combining marks that do not affect the width of the base character (“non-spacing marks”). Or you may be more liberal and include even marks that cannot stand alone, but still take up some space on the line when present; like vowel marks in Indic scripts. All three kinds of combining marks would be detected as follows:

    Private Shared Function HasDiacritics(input As String) As Boolean
        Dim uncombined As String = input.Normalize(NormalizationForm.FormD)
    
        For i As Integer = 0 To uncombined.Length - 1
            Dim uc As UnicodeCategory = 
                    CharUnicodeInfo.GetUnicodeCategory(uncombined(i))
    
            If uc = UnicodeCategory.NonSpacingMark
                    Or uc = UnicodeCategory.SpacingCombiningMark
                    Or uc = UnicodeCategory.EnclosingMark
                        Then
                            Return True
            End If
        Next
    
        Return False
    End Function
    

    Note the conversion to normal form D. This forces decomposition of all composed characters such as é to e and ' prior to looking at the string character by character.

    Now wait, you asked about the opposite, you wanted to detect whether the string contains a particular base character. That is even simpler.

    Private Shared Function HasChar(input As String, c as Char) As Boolean
        Dim uncombined As String = input.Normalize(NormalizationForm.FormD)
    
        For i As Integer = 0 To uncombined.Length - 1
            If uncombined(i) = c Then Return True End If
        Next
    
        Return False
    End Function
    

    In a similar vein, you might strip away particular categories of characters from each string separately, and only compare what remains.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering is there a way in PHP that you could tell where
Wondering if there is any way to get the lambda expressions that result from
I was wondering is there an elegant way of geting string[] from List<Tuple<int, int,
i was wondering if there is a way to use ASP.Net's Data annotation without
I was just wondering if there's a way (using ASP.NET C#) to shuffle up
I'm using vb.net 2008 edition and i was wondering if there a way to
Just wondering if there is a way to select all controls/items in asp.net/c# like
Is there any guaranteed way of determining the date that Office 2003 (and .Net
Wondering if there is a way to have multicolor text for ASP.NET Button Text.
I was wondering if there was a way that you could get init code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.