Question: string str="75,75,83,84" 

I want to remove repeating values from the string, I provide one example of a string.`string str+=Id.ToString() + ",";`

Answer: 
You can use [`string.Split`](https://learn.microsoft.com/en-us/dotnet/api/system.string.split?view=netframework-4.7.2) to split the string into separate values, e.g.

```
var input = "75,75,83,84";
var values = input.Split(',');

```

Afterwards, you can remove duplicates from the values using [`Enumerable.Distinct`](https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.distinct?view=netframework-4.7.2), e.g.:

```
var distinctValues = values.Distinct();

```

Then you can use [`string.Join`](https://learn.microsoft.com/en-us/dotnet/api/system.string.join?view=netframework-4.7.2) to join the string again, e.g.: 

```
var output = string.Join(",", distinctValues);

```
Using LINQ you can do:

```
string str = "75,75,83,84";
str = string.Join(",",str.Split(',').Distinct());

```