| Code to remove duplicate characters from given string
Below code will helps to to remove duplicate characters from particular string . Here we use for loop to find charcter one by one in string.
internal static void RemoveDuplicateStr(string str)
{
string result = string.Empty;
for (int i = 0; i < str.Length; i++)
{
if (!result.Contains(str[i]))
{
result+=str[i];
}
}
Console.WriteLine(result);
}
| | |