C# string.Replace for removing �?

Alfonso 141 Reputation points
2021-06-20T01:25:10.213+00:00

I am converting hex to a UTF8 string using below line.

var obInstruction = Encoding.UTF8.GetString(ob.Bits);

In the result I got � between every character as shown in the picture below.

what is �?

Result with UTF32
![added a picture for the result with UTF32

empty boxes with UTF32]2

So I added Replace to the line and changed it to var obInstruction = Encoding.UTF8.GetString(ob.Bits).Replace("�", ""); but � won't go away.

When I tried to replace other characters using Replace work fine but not for �.

What is � and how can I remove it?

In Power query, Text.Clean will remove such strange characters but I am not sure how to do in C#.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,141 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,207 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,887 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful