return the first non repeating character in a string in javascript

后端 未结 26 2457
清酒与你
清酒与你 2020-12-30 09:04

So I tried looking for this in the search but the closest I could come is a similar answer in several different languages, I would like to use Javascript to do it.

T

26条回答
  •  滥情空心
    2020-12-30 09:13

        //To find first non repeating letter 
        //It will check for both upper and lower case
        //only use one String.indexOf()
    
        var mystr="ohvhvtccggt";
        var checkFirstNonRepeating=function(){
        var ele=[];
          for(var i=0;i

提交回复
热议问题