Check out example codes for "find first non repeating character in a string". It will help you in understanding the concepts better.

Code Example 1

String given ="grepper";

for(char j :given.toCharArray()){
	if(given.indexOf(j)==given.lastIndexOf(j)){
		System.out.println(j);
		break;
  }
}

Code Example 2

class Solution(object):
   def firstUniqChar(self, s):
      """
      :type s: str
      :rtype: int
      """
      frequency = {}
      for i in s:
         if i not in frequency:
            frequency[i] = 1
         else:
            frequency[i] +=1
      for i in range(len(s)):
         if frequency[s[i]] == 1:
            return i
      return -1
ob1 = Solution()
print(ob1.firstUniqChar("people"))
print(ob1.firstUniqChar("abaabba"))

Learn ReactJs, React Native from akashmittal.com