Created
July 16, 2014 00:00
-
-
Save sburbidg/0841900c9f0c4016cce1 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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 stringDelimiter(input, delim){ | |
this.init = function(){ | |
this.input = input | |
this.delim = delim | |
this.array = [] | |
this.store = [] | |
this.strng = '' | |
// this.done = false | |
for(i = 0; i <= this.input.length; i++){ | |
if(this.input.charAt(i) != delim) {this.store.push(this.input.charAt(i)) | |
} else { | |
for(d = 0; d <= this.store.length; d++){ | |
this.strng += this.store.pop() | |
} | |
this.array.push(this.strng) | |
this.strng = '' | |
} | |
} | |
} | |
} | |
n = new stringDelimiter('imlitifjkstilokdtkmdoit', 't') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment