Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tlrobinson
on July 14, 2008
|
parent
|
context
|
favorite
| on:
Rewriting String.Left()
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
[–]
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: