Results 1 to 2 of 2

Thread: finding suffixe

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49
    Is there a way to find the suffix of a particular word that a user enter in a textbox using ASP or Javascript????
    Please Help

  2. #2
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137
    by suffix of a word i am assuming that you mean ..ing, ..ed, etc.

    The only way I can think of would be to write a function such as this.

    You have an array of all the possible suffixes call this suffixes

    Code:
    Private Function findSuffix(word as string) as string 
       
       Dim suffixes() as string, i as integer
       Dim tmpLen as integer   
    
       suffixes(0) = "ing"
       suffixes(1) = "er"
       suffixes(2) = "ed"
       
       'Return vbNullString by default
       findSuffix = vbNullString 
    
       For i = LBound(suffixes) to UBound(suffixes)
          tmpLen = Len(suffixes(i))
          If suffixes(i) = Right$(word, tmpLen) Then
             findSuffix = suffixes(i)
             Exit For
          Endif 
       Next
    
    End Function
    Only way I can think of

    Someone else may have a better idea
    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

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