Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# remove accents

static string RemoveDiacritics(string text) 
{
    var normalizedString = text.Normalize(NormalizationForm.FormD);
    var stringBuilder = new StringBuilder();

    foreach (var c in normalizedString)
    {
        var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
        if (unicodeCategory != UnicodeCategory.NonSpacingMark)
        {
            stringBuilder.Append(c);
        }
    }

    return stringBuilder.ToString().Normalize(NormalizationForm.FormC);
}
Comment

c# remove accents


static string RemoveDiacritics(string text) 
{
    var normalizedString = text.Normalize(NormalizationForm.FormD);
    var stringBuilder = new StringBuilder();

    foreach (var c in normalizedString)
    {
        var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
        if (unicodeCategory != UnicodeCategory.NonSpacingMark)
        {
            stringBuilder.Append(c);
        }
    }

    return stringBuilder.ToString().Normalize(NormalizationForm.FormC);
}

Comment

PREVIOUS NEXT
Code Example
Csharp :: c# tostring mmm dd yyyy 
Csharp :: c# private set 
Csharp :: c# date formats custom 
Csharp :: how to get random numbers in c# 
Csharp :: unity serializefield 
Csharp :: get all files in all subdirectories c# 
Csharp :: c# string capital first letter extension method 
Csharp :: move file c# 
Csharp :: unity smooth camera 2d 
Csharp :: c# datediff minutes 
Csharp :: c# require administrator permissions 
Csharp :: c# how to convert string to int 
Csharp :: how to create a rounded custom panel c# 
Csharp :: unity gameobject.findobjectswith tag set active 
Csharp :: unity open website url 
Csharp :: check if ienumerable is empty c# 
Csharp :: c# start as adminstrator 
Csharp :: c# determine configration at runtime 
Csharp :: c# how to output in between 0 - 100 in an int array 
Csharp :: how to open any file on button click in winforms 
Csharp :: enable canvas unity 
Csharp :: c# datatable copy selected rows to another table 
Csharp :: c# unity 2d play video 
Csharp :: monogame fullscreen 
Csharp :: unity animator current state name 
Csharp :: solve fizzbuz c# 
Csharp :: c# display a variable to a text gameobject 
Csharp :: unity access phone camera 
Csharp :: c# regex to find number between parenthesis 
Csharp :: delete file from FTP c# 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =