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
a local clone.
dmd.root.string
This module contains various string related functions.
Compiler implementation of the D programming language
http://dlang.org
Authors:
Walter Bright, http://www.digitalmars.com
License:
Source root/string.d
Documentation https://dlang.org/phobos/dmd_root_string.html
- pure nothrow @nogc inout(char)[]
toDString
(inout(char)*s
); - Slices a \0-terminated C-string, excluding the terminator
- static bool
iequals
(const(char)[]s1
, const(char)[]s2
); - Compare two slices for equality, in a case-insensitive wayComparison is based on char and does not do decoding. As a result, it's only really accurate for plain ASCII strings.Parameters:
const(char)[] s1
string to compare const(char)[] s2
string to compare Returns:true ifs1
==s2
regardless of case - nothrow auto
toCStringThen
(alias dg)(const(char)[]src
); - Copy the content of
src
into a C-string ('\0' terminated) then call dgThe intent of this function is to provide an allocation-less way to call a C function using a D slice. The function internally allocates a buffer if needed, but frees it on exit.Note The argument to dg is scope. To keep the data around after dg exits, one has to copy it.
Parameters:const(char)[] src
Slice to use to call the C function dg Delegate to call afterwards Returns:The return value of T - pure nothrow @nogc @safe string
stripLeadingLineTerminator
(stringstr
); - Strips one leading line terminator of the given string.The following are what the Unicode standard considers as line terminators: | Name | D Escape Sequence | Unicode Code Point | |---------------------|-------------------|--------------------| | Line feed | \n | U+000A | | Line tabulation | \v | U+000B | | Form feed | \f | U+000C | | Carriage return | \r | U+000D | | Next line | | U+0085 | | Line separator | | U+2028 | | Paragraph separator | | U+2029 | This function will also strip \n\r.
Copyright © 1999-2022 by the D Language Foundation | Page generated by
Ddoc on (no date time)