c# - Get the index of the nth occurrence of a string? -


unless missing obvious built-in method, quickest way nth occurrence of string within string?

i realize loop indexof method updating start index on each iteration of loop. doing way seems wasteful me.

that's need - or @ least, it's easiest solution. you'd "wasting" cost of n method invocations - won't checking case twice, if think it. (indexof return finds match, , you'll keep going left off.)


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -