VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Find a string inside another string. Returns number of hits.

by Mathieu Klomp (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 26th March 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Find a string inside another string. Returns number of hits.

Rate Find a string inside another string. Returns number of hits.



If MatchCase Then FindString = (Len(Source) - Len(Replace(Source, Find, ""))) / Len(Find)
If Not MatchCase Then FindString = (Len(Source) - Len(Replace(LCase(Source), LCase(Find), ""))) / Len(Find)
'Easy, aint it? have fun! Mathieu Klomp.
End Function

Download this snippet    Add to My Saved Code

Find a string inside another string. Returns number of hits. Comments

No comments have been posted about Find a string inside another string. Returns number of hits.. Why not be the first to post a comment about Find a string inside another string. Returns number of hits..

Post your comment

Subject:
Message:
0/1000 characters