View source code
							
							
						
								Display the source code in std/string.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.
							
						Function std.string.stripLeft
Strips leading whitespace (as defined by isWhite) or
    as specified in the second argument.
						
				auto auto stripLeft(Range)
				(
				
				  Range input
				
				)
				
				if (isForwardRange!Range && isSomeChar!(ElementEncodingType!Range) && !isInfinite!Range && !isConvertibleToString!Range);
				
				
				auto auto stripLeft(Range, Char)
				(
				
				  Range input,
				
				  const(Char)[] chars
				
				)
				
				if ((isForwardRange!Range && isSomeChar!(ElementEncodingType!Range) || isConvertibleToString!Range) && isSomeChar!Char);
						
					
				Parameters
| Name | Description | 
|---|---|
| input | string or forward range of characters | 
| chars | string of characters to be stripped | 
Returns
input stripped of leading whitespace or characters
    specified in the second argument.
Postconditions
input and the returned value
    will share the same tail (see sameTail).
See Also
Generic stripping on ranges: stripLeft
Example
import stdExample
assert(stripLeft("     hello world     ", " ") ==
       "hello world     ");
assert(stripLeft("xxxxxhello world     ", "x") ==
       "hello world     ");
assert(stripLeft("xxxyy    hello world     ", "xy ") ==
       "hello world     ");
Example
import stdAuthors
Walter Bright, Andrei Alexandrescu, Jonathan M Davis, and David L. 'SpottedTiger' Davis
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.