I need help writing a function; I don't need it written for me. I more or less need good direction. The function that I am trying to write is in Visual Basic.net. Here's the problem:
Write a function called WordCount that takes two String parameters and returns the count of how many times the first string appears in the second string. The search should be case-sensitive so Yes should not match yes. The program that calls the function will have two textboxes, a label and a button. So when the user enters a word in textbox1 and a sentence in textbox2 then click on the button, the count of how many times the text from textbox1 appears in the text from textbox2 will appear in the label.
Okay, so I have my declaration below:
Function WordCount(First as string, Second as string) as String
dim fLength as string
dim sLength as string
if fLength > sLength
[login to view URL]("Invalid Entry! Try again ... ")
end if
No I am stuck. I'm assuming that I will need a Do Loop to search the string but I'm not sure exactly how to code it.
Do
count += count
Loop Until ?????????
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
visual [login to view URL] on windows xp