Find the Nth Occurrence of a Character in a String
T-SQL's CHARINDEX() function is a useful for parsing out characters within a string. However, it only returns the first occurrence of a character. Oftentimes one needs to locate the Nth instance of a character or a space, which can be a complicated task in standard T-SQL. This function I wrote, imaginatively named CHARINDEX2(), allows one […]
2002-09-27
32,626 reads