View source code
							
							
						
								Display the source code in std/conv.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.conv.toChars
Convert integer to a range of characters. Intended to be lightweight and fast.
						
				auto toChars(ubyte radix = 10, Char, LetterCase letterCase = LetterCase
				  T value
				
				) pure nothrow @nogc @safe
				
				if ((radix == 2 || radix == 8 || radix == 10 || radix == 16) && (is(immutable(T) == immutable(uint)) || is(immutable(T) == immutable(ulong)) || radix == 10 && (is(immutable(T) == immutable(int)) || is(immutable(T) == immutable(long)))));
						
					
				Parameters
| Name | Description | 
|---|---|
| radix | 2, 8, 10, 16 | 
| Char | character type for output | 
| letterCase | lower for deadbeef, upper for DEADBEEF | 
| value | integer to convert. Can be uint or ulong. If radix is 10, can also be int or long. | 
Returns
Random access range with slicing and everything
Example
import stdAuthors
Walter Bright, Andrei Alexandrescu, Shin Fujishiro, Adam D. Ruppe, Kenji Hara
License
					Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.