Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Strings in D have .length property which is used to calculate the number of characters in a string. Note: Spaces are calculated. Here is an example: import std.stdio; void main() { s...
Answer
#3: Post edited
- Strings in D have `.length` property which is used to calculate the number of characters in a string.
**Note:** Spaces are **not** calculated.- Here is an example:
- ```
- import std.stdio;
main() {- string s = "Hello, World!";
- write(s.length);
- }
- ```
- Learn more about D in [Documentation](https://dlang.org/).
- Strings in D have `.length` property which is used to calculate the number of characters in a string.
- **Note:** Spaces are calculated.
- Here is an example:
- ```
- import std.stdio;
- void main() {
- string s = "Hello, World!";
- write(s.length);
- }
- ```
- Learn more about D in [Documentation](https://dlang.org/).
#2: Post edited
- Strings in D have `.length` property which is used to calculate the number of characters in a string.
`Note:` Spaces are **not** calculated.- Here is an example:
- ```
- import std.stdio;
- main() {
- string s = "Hello, World!";
- write(s.length);
- }
- ```
- Learn more about D in [Documentation](https://dlang.org/).
- Strings in D have `.length` property which is used to calculate the number of characters in a string.
- **Note:** Spaces are **not** calculated.
- Here is an example:
- ```
- import std.stdio;
- main() {
- string s = "Hello, World!";
- write(s.length);
- }
- ```
- Learn more about D in [Documentation](https://dlang.org/).
#1: Initial revision
Strings in D have `.length` property which is used to calculate the number of characters in a string. `Note:` Spaces are **not** calculated. Here is an example: ``` import std.stdio; main() { string s = "Hello, World!"; write(s.length); } ``` Learn more about D in [Documentation](https://dlang.org/).