Timeline for Counting occurrences of substring in string
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 31, 2015 at 10:25 | comment | added | nhgrif | @craftworkgames It's still a community wiki answer and you're still more than welcome to improve it in any way you see fit. | |
Mar 31, 2015 at 6:26 | comment | added | craftworkgames | Knowing different ways to code something is great. That's what code reviews are all about. It's just that "The biggest problems with 'premature optimization' are that it can introduce unexpected bugs and can be a huge time waster." programmers.stackexchange.com/questions/80084/… | |
Mar 31, 2015 at 0:25 | comment | added | user34073 |
@craftworkgames Probably true, but using .Length is probably the more correct version, and my code needs to be fast as it will be running on mobile devices as well as desktops.
|
|
Mar 31, 2015 at 0:24 | comment | added | nhgrif | @craftworkgames It's a community wiki answer. You're welcome to improve it as you see fit. | |
Mar 31, 2015 at 0:23 | comment | added | craftworkgames |
"probably pretty expensive" and "very inefficient" are not terms I would use to describe Count() and splitting strings. These are micro-optimizations and most of the time won't make a licking difference. Almost certainly, the implementation of Count() just returns Length for a string.
|
|
Mar 30, 2015 at 1:25 | vote | accept | CommunityBot | moved from User.Id=34073 by developer User.Id=8983 | |
Mar 30, 2015 at 1:21 | history | edited | nhgrif | CC BY-SA 3.0 |
added 113 characters in body
|
Mar 30, 2015 at 1:16 | history | edited | nhgrif | CC BY-SA 3.0 |
added 113 characters in body
|
Mar 30, 2015 at 1:09 | history | made wiki | Post Made Community Wiki by nhgrif | ||
Mar 30, 2015 at 1:03 | history | rollback | nhgrif |
Rollback to Revision 3
|
|
Mar 30, 2015 at 1:02 | history | edited | nhgrif | CC BY-SA 3.0 |
added 30 characters in body
|
Mar 30, 2015 at 0:55 | history | edited | nhgrif | CC BY-SA 3.0 |
added 550 characters in body
|
Mar 30, 2015 at 0:34 | comment | added | user34073 |
Calling .IndexOf() with a startingIndex greater than the length of the string crashes, but it actually works in this statement because the assignment fails.
|
|
Mar 30, 2015 at 0:26 | history | edited | nhgrif | CC BY-SA 3.0 |
added 10 characters in body
|
Mar 30, 2015 at 0:16 | history | edited | nhgrif | CC BY-SA 3.0 |
edited body
|
Mar 30, 2015 at 0:08 | history | answered | nhgrif | CC BY-SA 3.0 |