Function String Words Class ★ Top 20 Most Useful

DictionaryOrder

Return a string representing the dictionary order of the string vValue. If the string begins with any of the words in vRotateWords, those words are moved to the end of the string.

Signature (Visual Basic / VBA)

Public Function DictionaryOrder( _
      ByVal vValue As Variant _
    , Optional ByVal vRotateWords As Variant _
    , Optional ByVal vSeparator As Variant _
    ) As Variant

Code Example

    DictionaryOrder("Entisoft Tools") = "Entisoft Tools"
    DictionaryOrder("The Entisoft Tools Library") = "Entisoft Tools Library, The"

Parameters

Parameter Description
vValue String containing the phrase which should be converted to its dictionary order. Function returns Null if vValue is Null or cannot be fixed up to a String.
vRotateWords String containing a list of words which should be moved to the end of the string if they appear at the beginning of it. vRotateWords defaults to the string "A AN THE" if it is missing or Null or cannot be fixed up to a String.
vSeparator String which separates each of the words within string vRotateWords. vSeparator defaults to a space character if it is missing or Null or cannot be fixed up to a String.

Notes & Version History

Note Function uses Binary comparisons to locate the separator string vSeparator within string vValue.
Note Function uses Text comparisons to locate the "rotate" words at the beginning of string vValue.