Created
November 20, 2012 03:47
-
-
Save kusold/4115820 to your computer and use it in GitHub Desktop.
STRSTR Fasta
This file contains hidden or 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
string = "foobarfoofoobarbar" | |
list_of_dupes = [] | |
for(int i = string.length; i > 1; i--) | |
{ | |
slice_size = string.length / i; | |
temp_string = string | |
slice_to_check_for_uniqueness = temp_string.slice(FROM 0, TO slice_size); #I'm assuming slice consumes. | |
while(temp_string.contains(slice_to_check_for_uniqueness) != null) | |
{ | |
list_of_dupes.add(slice_to_check_for_uniqueness); | |
temp_string.remove(slice_to_check_for_uniqueness); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment