string r0 = "bcdaaaa"; r0.popBackWhile!"a == 'a'"; assert(r0 == "bcd"); static bool lessTwo(T)(T t) { return t < 2; } int[] r1 = [0,1,2,2,1,0]; r1.popBackWhile!lessTwo; assert(r1 == [0,1,2,2]); static bool posLessFive(T)(T t) { return t < 5 && t > 0; } int[] r3 = [-1,2,3,4]; r3.popBackWhile!posLessFive; assert(r3 == [-1]); int[] r4 = [5,2,3,4]; r4.popBackWhile!posLessFive; assert(r4 == [5]);
Pops back an input range while a predicate is true. Consumes the input argument.