To find the first non-repeating character in a string in C#, you can use a dictionary to count the occurrences of each character, then iterate through the string to find the first character with a count of 1.
•First, count how many times each character appears.
•Then, iterate through the string again to find the first character with a count of 1.
•If none found, return '\0' (null character).
For the input "swiss", the output will be:
First non-repeating character: w