VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Substring Count - Very short and efficient code - 2 Lines of code

by 666 (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 21st October 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Substring Count - Very short and efficient code - 2 Lines of code

Rate Substring Count - Very short and efficient code - 2 Lines of code




  If InThis = "" Or HowManyOfThese = "" Then Exit Function
  SubstringCount = (Len(InThis) - Len(Replace(InThis, HowManyOfThese, "", Compare:=CompareMethod))) / Len(HowManyOfThese)

End Function


Download this snippet    Add to My Saved Code

Substring Count - Very short and efficient code - 2 Lines of code Comments

No comments have been posted about Substring Count - Very short and efficient code - 2 Lines of code. Why not be the first to post a comment about Substring Count - Very short and efficient code - 2 Lines of code.

Post your comment

Subject:
Message:
0/1000 characters