Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,16 @@
void main() {
import std.stdio;
import std.algorithm: startsWith, endsWith, find, countUntil;
"abcd".startsWith("ab").writeln; // true
"abcd".endsWith("zn").writeln; // false
"abab".find("bb").writeln; // empty array (no match)
"abcd".find("bc").writeln; // "bcd" (substring start
// at match)
"abab".countUntil("bb").writeln; // -1 (no match)
"abab".countUntil("ba").writeln; // 1 (index of 1st match)
// std.algorithm.startsWith also works on arrays and ranges:
[1, 2, 3].countUntil(3).writeln; // 2
[1, 2, 3].countUntil([2, 3]).writeln; // 1
}