Thread overview
D modules
Nov 13, 2021
pascal111
Nov 13, 2021
Imperatorn
Nov 14, 2021
Mike Parker
Nov 14, 2021
Adam Ruppe
November 13, 2021

When I'm searching for "toUpper" and "toLower" functions that string type uses, I confused when I reached the module "std.string". In the first section of its page "https://dlang.org/phobos/std_string.html" I didn't found functions I'm searching for, but when I pressed ctrl+f and typed function names, I found 'em in another section of the page, but I didn't understand if I have to add something to module name "std.string" or not, and I don't know how modules divided nor its sections way in D. I hope someone clarifies this obscure point to me and how can I search correctly for sought functions.

November 13, 2021

On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote:

>

When I'm searching for "toUpper" and "toLower" functions that string type uses, I confused when I reached the module "std.string". In the first section of its page "https://dlang.org/phobos/std_string.html" I didn't found functions I'm searching for, but when I pressed ctrl+f and typed function names, I found 'em in another section of the page, but I didn't understand if I have to add something to module name "std.string" or not, and I don't know how modules divided nor its sections way in D. I hope someone clarifies this obscure point to me and how can I search correctly for sought functions.

They are publicly imported from std.uni

November 14, 2021

On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote:

>

When I'm searching for "toUpper" and "toLower" functions that string type uses, I confused when I reached the module "std.string". In the first section of its page "https://dlang.org/phobos/std_string.html" I didn't found functions I'm searching for, but when I pressed ctrl+f and typed function names, I found 'em in another section of the page, but I didn't understand if I have to add something to module name "std.string" or not, and I don't know how modules divided nor its sections way in D. I hope someone clarifies this obscure point to me and how can I search correctly for sought functions.

Those functions used to be in std.string a long time ago and are no more. As did some others. The section where you found them in the std.string docs is a table listing their current location in std.uni and links to their documentation. It also says this just above the table:

>

The following functions are publicly imported:

This means if you are already importing std.string, you do not need to import std.uni for toUpper and toLower, as std.string publicly imports them, so they will be available for you to use. So you can use those functions by importing std.string or std.uni.

https://dlang.org/phobos/std_uni.html#.toLower
https://dlang.org/phobos/std_uni.html#.toUpper

November 14, 2021

On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote:

>

When I'm searching for "toUpper" and "toLower" functions that string type uses

They are usable though import std.string; the docs just don't do a great job showing that.

The newest test version of my doc generator does integrate them into the member list though:

http://dpldocs.info/experimental-docs/std.string.html

My dpldocs.info website has a search engine too to help find the original place:

dpldocs.info/toLower

for example will point you at std.uni first.

But if it is "public imported" into a member list of another module you can use it just importing either way.