0
public string FaraDiacritice(string x)
    {
        return x.Replace("ă", "a").Replace("î", "i").Replace("â", "a").Replace("ș", "s").Replace("ț", "t");
    }

I'm using Unity and Visual Studio Comunity 2022, maybe it does not support unicode characters somehow. Even if

        Debug.Log(FaraDiacritice("ăîâșț"));

works

Debug Log in Unity saying aiast

I am using it in this context:

A1.text = FaraDiacritice(TextScript.instance.GetAnswer(Raspunsuri.instance.Q6[1]));

I don't want all the diacritics changed, even though I know thats posible, I just want to fix my code.

Vladutzu27
  • 55
  • 9
  • I don't understand ... so if `Debug.Log(FaraDiacritice("ăîâșț"));` works correctly ... then what doesn't? What exactly is the content of `TextScript.instance.GetAnswer(Raspunsuri.instance.Q6[1])` ? – derHugo Jan 09 '23 at 10:21
  • @derHugo I set a textmeshpro text to that and Q1-Q6 are lists of answers – Vladutzu27 Jan 09 '23 at 10:29
  • yeah .. but what is the content exactly? I guess it just doesn't match exactly with the same characters ... As an off-topic side note, avoid using those singletons – derHugo Jan 09 '23 at 10:30

0 Answers0