Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Rewriting String.Left()
(
wordaligned.org
)
12 points
by
sanj
on July 14, 2008
|
hide
|
past
|
favorite
|
2 comments
tlrobinson
on July 14, 2008
[–]
I don't know C#, but in most languages I know, this string.left(n) method is just equivalent to string.substring(0, n).
crescendo
on July 14, 2008
|
parent
[–]
Actually, string.Substring(0, n) is also the C# idiom. The orignial blogger is essentially creating a method alias Left(n) => Substring(0, n), which IMO is not a good use for extension methods.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: