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
Post a Comment