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 :)
Printable View
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 :)
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
Only way I can think ofCode:
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
Someone else may have a better idea