View source code
					
 Display the source code in std/range.d from which this page was generated on
 github.
					
				
				
 Improve this page
					
 Quickly fork, edit online, and submit a pull request for this page.
 Requires a signed-in GitHub account. This works well for small changes.
 If you'd like to make larger changes you may want to consider using
 local clone.
					
				
				
 Page wiki
					
 View or edit the community-maintained wiki page associated with this page.
					
				
			
			Function std.range.dropBackExactly
			    Similar to drop and dropBackrange.popFrontExactly( and n)range.popBackExactly(
    instead.
n)
Prototype
R dropBackExactly(R)( R range, size_t n ) if (isBidirectionalRange!R);
Note
Unlike dropdropExactlyrange holds at least ndropExactlydroprangenpopFront
    on an empty range, which is undefined behavior. So, only use
    popFrontExactly when it is guaranteed that rangen
Example
import std.algorithm : equal, filterBidirectional; auto a = [1, 2, 3]; assert(a.dropExactly(2) == [3]); assert(a.dropBackExactly(2) == [1]); string s = "日本語"; assert(s.dropExactly(2) == "語"); assert(s.dropBackExactly(2) == "日"); auto bd = filterBidirectional!"true"([1, 2, 3]); assert(bd.dropExactly(2).equal([3])); assert(bd.dropBackExactly(2).equal([1]));
Authors
Andrei Alexandrescu, David Simcha, and Jonathan M Davis. Credit for some of the ideas in building this module goes to Leonardo Maffi.