Created
November 1, 2024 10:39
-
-
Save otuva/45758f42990e011f01176e32954441eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define a dictionary of Turkish characters and their replacements | |
$turkishChars = @{ | |
'ç' = 'c' | |
'Ç' = 'C' | |
'ğ' = 'g' | |
'Ğ' = 'G' | |
'ı' = 'i' | |
'İ' = 'I' | |
'ö' = 'o' | |
'Ö' = 'O' | |
'ş' = 's' | |
'Ş' = 'S' | |
'ü' = 'u' | |
'Ü' = 'U' | |
} | |
# Original string with Turkish characters | |
$string = "Çeşitli Türkçe karakterler: ç, ğ, ı, İ, ö, Ö, ş, Ş, ü, Ü" | |
# Replace each Turkish character with its equivalent | |
foreach ($char in $turkishChars.Keys) { | |
$string = $string -replace [regex]::Escape($char), $turkishChars[$char] | |
} | |
# Display the modified string | |
$string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment