View source code
Display the source code in dmd/root/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.

Module dmd.root.string

Contains various string related functions.

Documentation

https://dlang.org/phobos/dmd_root_string.html

Coverage

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/root/string.d

Functions

NameDescription
dstrcmp(s1, s2) A string comparison functions that returns the same result as strcmp
iequals(s1, s2) Compare two slices for equality, in a case-insensitive way
startsWith(p, needle) Checks if C string p starts with needle.
stripLeadingLineTerminator(str) Strips one leading line terminator of the given string.
toCStringThen(src) Copy the content of src into a C-string ('\0' terminated) then call dg
toDString(s) Slices a \0-terminated C-string, excluding the terminator
toStaticArray(literal) Infers the length N of a string literal and coerces its type to a static array with length N + 1. Returns the string with a null character appended to the end.

Authors

Walter Bright, https://www.digitalmars.com

License

Boost License 1.0