Skip to content

Instantly share code, notes, and snippets.

Lance Ruegger lancekruegger

Block or report user

Report or block lancekruegger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View duplicates.js
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");
You can’t perform that action at this time.