Horje
First non repeating character position in a string Code Example
First non repeating character position in a string
// First non repeating character position in a string

function first_non_repeating_letter(str) {
  for(var i = 0; i < str.length; i++) {
    if (str.indexOf(str[i]) === str.lastIndexOf(str[i])) {
      return i
    }
  }
  return null
}

console.log("First non repeating character position = " + 
    first_non_repeating_letter("abcdcba"));  //3




Javascript

Related
catch the last item in a array js Code Example catch the last item in a array js Code Example
jest test coverage Code Example jest test coverage Code Example
javascript check if link is clicked Code Example javascript check if link is clicked Code Example
string to number javascript & remove text Code Example string to number javascript & remove text Code Example
javascript while function is not defined wait Code Example javascript while function is not defined wait Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7