dropStringIf

This commit is contained in:
2022-07-03 01:46:46 +00:00
parent 12a2705d20
commit 634d36b922

View File

@@ -170,6 +170,15 @@ class Stream {
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) {
dropChars(content.indexOf(s));
}