js char in string code example Example: find char in string javascript var str = "Hello world, welcome to the universe."; var n = str.indexOf("e");