What order of time does the .NET System.String.Length property take?
Posted
by Matthew
on Stack Overflow
See other posts from Stack Overflow
or by Matthew
Published on 2010-05-14T17:28:41Z
Indexed on
2010/05/14
17:34 UTC
Read the original article
Hit count: 226
I had someone advise me to avoid repeatedly calling String.Length
, because it was recalculated each time I called it. I had assumed that String.Length
ran in O(1) time. Is String.Length
more complex than that?
© Stack Overflow or respective owner