PoshCode Archive  Artifact Content

Artifact 1ae03b8127e8fa65f9c41edbe6667630ca06a5c01b77db436cea821326447e9e:

  • File Remove-diacritics.ps1 — part of check-in [7ae657e00e] at 2018-06-10 13:55:10 on branch trunk — Remove diacritics from string : (user: Grgory Schiro size: 715)

# encoding: utf-8
# api: powershell
# title: Remove diacritics
# description: Remove diacritics from string :
# version: 0.1
# type: function
# author: Grgory Schiro
# license: CC0
# function: Remove-Diacritics
# x-poshcode-id: 5423
# x-archived: 2017-05-17T23:56:42
# x-published: 2017-09-13T23:24:00
#
# PS> Remove-Diacritics -String ‘’
# eaceoiinua
#
### Grégory Schiro, 2009

### <summary>
### Removes diacritics from string.
### </summary>
### <param name="String">String containing diacritics</param>
function Remove-Diacritics([string]$String)
{
    ($String.Normalize([Text.NormalizationForm]::FormD)-replace'\p{Mn}').Normalize([Text.NormalizationForm]::FormC)
}