Code Duplication    Length = 14-14 lines in 2 locations

src/ub.strings.charrange.js 2 locations

@@ 177-190 (lines=14) @@
174
		}
175
		return text.substr(idx);
176
	},
177
	beforeCharRange: function(type, inclusive = true, startAt = 0, forward = true, returnAll = true){
178
		var text = this;
179
		if (text == null) { return returnAll ? text : ''; }
180
		if (forward) {
181
			var idx = text.indexOfCharRange(type, startAt);
182
		}else {
183
			idx = text.lastIndexOfCharRange(type);
184
		}
185
		if (idx === -1) { return returnAll ? text : ''; }
186
		if (!inclusive) {
187
			idx--;
188
		}
189
		return text.substr(0, idx);
190
	},
191
	
192
	// digits
193
	removeDigits: function(){
@@ 163-176 (lines=14) @@
160
		}
161
		return output.join("");
162
	},
163
	afterCharRange: function(type, inclusive = true, startAt = 0, forward = true, returnAll = true){
164
		var text = this;
165
		if (text == null) { return returnAll ? text : ''; }
166
		if (!forward) {
167
			var idx = text.lastIndexOfCharRange(type);
168
		}else {
169
			idx = text.indexOfCharRange(type, startAt);
170
		}
171
		if (idx === -1) { return returnAll ? text : ''; }
172
		if (!inclusive) {
173
			idx++;
174
		}
175
		return text.substr(idx);
176
	},
177
	beforeCharRange: function(type, inclusive = true, startAt = 0, forward = true, returnAll = true){
178
		var text = this;
179
		if (text == null) { return returnAll ? text : ''; }