Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

C Sharp string.Length

From Coderwiki
Revision as of 11:15, 15 August 2025 by Dylan (talk | contribs) (add example/output section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In C Sharp, any string has the Length property.

You can access it by calling .Length on any string object.

string name = "Bob";
int length = name.Length;
Console.WriteLine(name);

Output:

3
Contents