UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> IsWordUnique    


Synopsis

Some text to numerical encryption methods, such as SARNEG and RAMROD, require that the keyword has no repeating letters.

CODE
' IsWordUnique
' http://www.utteraccess.com/wiki/IsWordUnique
' Code courtesy of UtterAccess Wiki
' Licensed under Creative Commons License
' http://creativecommons.org/licenses/by-sa/3.0/
'
' You are free to use this code in any application,
' provided this notice is left unchanged.
'
' rev  date                          brief descripton
' 1.0  2012-09-26                    This function uses recursion to verify if a word has no repeating letters.
'
Public Function IsWordUnique(strWord As String, Optional intPos As Integer = 1) As Boolean

If intPos = Len(strWord) Then
   IsWordUnique = True
ElseIf Len(strWord) - Len(Replace(strWord, Mid(strWord, intPos, 1), "")) = 1 Then
   IsWordUnique = IsWordUnique(strWord, intPos + 1)
End If

End Function

Creative Commons License
IsWordUnique by UtterAccess Wiki is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Editing and revision of the content is freely encouraged; for details, see Expected Usage.

Edit Discussion
Custom Search
Thank you for your support!
This page has been accessed 3,243 times.  This page was last modified 16:36, 26 September 2012 by TheDBguy.   Disclaimers