This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDuplicates(str) | |
{ | |
var duplicates = ""; | |
while (str.length > 0) { | |
// Adds a placeholder for the string at the current position before we run replace | |
var cur_str = str; | |
// Searches for all instances of char in string and replaces them with nothing | |
var regex = new RegExp(str[0], "g"); |