Results 1 to 3 of 3

Thread: Find the word and count it up

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    ENGLAND
    Posts
    38

    Find the word and count it up

    Dear All
    I would like to find certain Word in the TextBox and Count it up and display it.
    Many Thanks for any Reply
    salih
    sa

  2. #2
    New Member
    Join Date
    May 2003
    Posts
    4
    I have not actually tried this in .net, but in vb6 you would use the InStr command where you specify the string to search and the string to find. It returns the position as a long (variant).

    Can't guarantee its available in .net as well. I have vb6 here (work) and .net at home, so can't test it

  3. #3
    Lively Member
    Join Date
    Feb 2003
    Location
    UK
    Posts
    95
    you can use IndexOf to find the first occurence of a string or charcter in another string. (lots of overloaded versions available)

    Not sure what you mean by count it up? if you mean the position of the word within the string then use IndexOf, or if you mean count up every occurence then I'd use a regular expression.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width