dropStringIf
This commit is contained in:
@@ -170,6 +170,15 @@ class Stream {
|
|||||||
dropChars(s.length);
|
dropChars(s.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dropStringIf(s:String):Bool {
|
||||||
|
var toDrop = content.substr(0, s.length);
|
||||||
|
if (toDrop == s) {
|
||||||
|
dropString(toDrop);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function dropUntil(s:String) {
|
public function dropUntil(s:String) {
|
||||||
dropChars(content.indexOf(s));
|
dropChars(content.indexOf(s));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user