DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Find The Count Of A Given Character In A Text String
ASP / VBScript offers no built-in functionality for this.
CharacterCount = Len(MyString) - Len(Replace(MyString, TargetCharacter, ""))






Comments
Snippets Manager replied on Tue, 2011/07/26 - 2:22pm
arrCount = Split(MyString, TargetCharacter, -1 1) CharacterCount = UBound(arrCount)