hello

 

hello there, please does anyone know how to create a non visual class that has the behaviour to count characters, words, alphabets, vowels, consonants, digits

i am working on a form that needs a class to be added in other to be run.

it involves counting i.e words, characters e.t.c as above.

i have an idea of how to add a non visual class but the problem is how to put the behaviours (codes) for counting characters, words e.t.c

thanks



Answer this question

hello

  • BilalShouman

    yeah i understand, i will send my code for you to cross check.

    didn't mean to put through like that.

    thanks once again


  • Kevin Stephens

    Babalicious,

    The following example demonstrates how to split a string at its spaces.

    Dim TestString As String = "Look at these!"

    ' Returns an array containing "Look", "at", and "these!".

    Dim TestArray() As String = Split(TestString)

    The following example demonstrates how to split strings with multiple delimiters in a row and filter out the empty strings.

    Dim TestString As String = "apple pear banana "

    Dim TestArray() As String = Split(TestString)

    ' TestArray holds {"apple", "", "", "", "pear", "banana", "", ""}

    Dim LastNonEmpty As Integer = -1

    For i As Integer = 0 To TestArray.Length - 1

    If TestArray(i) <> "" Then

    LastNonEmpty += 1

    TestArray(LastNonEmpty) = TestArray(i)

    End If

    Next

    ReDim Preserve TestArray(LastNonEmpty)



  • TazzyTaz

    We have a thing on these forums, when we see a question which is obviously a homework assignment. We will answer specific problems/questions related to the problem but would not simply do you complete assignment for you.

    It is often best to show us your code so we can help you where possible but we do not send out complete homework assignments.

    So if you have a specific issue then ask the question, but homework assignments are designed to test you understanding and knowledge of the subject being taught. Not you ability to ask someone else to do it. Please do not take offense here and if you are still having problems and want to see how its done, ask in 3 weeks time. The reason I say this is homework assignments tend to be shorter than this and if it is "just for information" and not to hand in as your own work, then I'm sure we can help then.

    Sorry if this is not to your liking, but I had to do my own homework when I was learning and didnt have the internet as a research tool as did many of the other moderators on these forums. I would suggest discussing with your teacher if you really have no clue how to start implementing a solution so they can point you in the right direction and provide assistance for your learning (which is what they are there for).

    Also please do not cross post the same question on multiple forums, as it simply clutters up the forums with the same question.



    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1028362&SiteID=1

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1024847&SiteID=1

    You last posting makes it very very clear that this is just a homework assignment.


  • Robert6327

    What you can do is tokenize the string by using the split functionality (see string.Split in MSDN). That will give you an array of word tokens. From that array one can get the count. From there t write code to enumerate the array of words and do proper processing on the words to get the other items.




  • hello