View source code
							
							
						
								Display the source code in std/algorithm/iteration.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								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.
							
						Template std.algorithm.iteration.substitute
Returns a range with all occurrences of substs in r.
replaced with their substitution.
						
				template substitute(substs...)
				;
						
						
				
				
				auto substitute(alias pred, R, Substs...)
				(
				
				  R r,
				
				  Substs substs
				
				)
				
				if (isInputRange!R && (Substs
				Single value replacements ('ö') are
supported as well and in Ο(1).
Template substitute
Contained Functions
| Name | Description | 
|---|---|
| substitute | Substitute single values with compile-time substitution mappings. | 
Function substitute
Parameters
| Name | Description | 
|---|---|
| r | an input range | 
| value | a single value which can be substituted in Ο( 1) | 
| substs | a set of replacements/substitutions | 
| pred | the equality function to test if element(s) are equal to a substitution | 
Returns
a range with the substitutions replaced.
See Also
replace for an eager replace algorithm or
translate, and tr
for string algorithms with translation tables.
Example
import stdExample
Use the faster compile-time overload
import stdExample
Multiple substitutes
import stdAuthors
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.