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.
This module contains various string related functions.
Compiler implementation of the D programming language http://dlang.org
Walter Bright, http://www.digitalmars.com
- pure nothrow @nogc inout(char)
- Slices a \0-terminated C-string, excluding the terminator
- static bool
- 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:
string to compare const(char)
string to compareReturns:true if
s2regardless of case
- nothrow auto
- Copy the content of
srcinto 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:
Slice to use to call the C function dg Delegate to call afterwardsReturns:The return value of T
- pure nothrow @nogc @safe string
- 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.