Return the First Unique Character Without Using Inbuilt Functions Using C# – Programming, Pseudocode Example, C# Programming Example
C# C# Console

Return the First Unique Character Without Using Inbuilt Functions Using C#

In this example,i’ll show you How to return the first unique character without using inbuilt functions using C#.

Create an empty new array of length 256, traverse through the entire string character by character and increment the value in the new array. At the end traverse the entire array and return the first character that has value 1.

Example 1

aabccd -→2 1 2 1 → Return the first character which is having count 1. That is b by subtracting with the ascii values.

Example 2

Output:

k

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.