Public Function CapitalizeLike( _ ByVal vString As Variant _ , ByVal vPattern As Variant _ ) As Variant
CapitalizeLike("attaboy", "AbCdEfGhIj") = "AtTaBoY" CapitalizeLike("attaboy", "ABCD") = "ATTAboy" CapitalizeLike("attaboy", "ABC123ABC") = "ATTaboY" CapitalizeLike("ATTABOY", "abc123abc") = "attABOy"See also:
RandomCapitalize Function SwapUpperAndLowerCase FunctionvString: The string whose capitalization is to be changed to correspond to that of vPattern. Function returns Null if vString is Null or cannot be fixed up to a String.
vPattern: The string whose capitalization is to be mimicked within the other string. Function returns Null if vPattern is Null or cannot be fixed up to a String.
Note: Function only works for characters in the ANSI Windows character set because it uses the built-in Visual Basic UCase$() and LCase$() functions.
Note: If the string vString is longer than the pattern, then the characters in vString positions beyond the length of the pattern remain unchanged, as in example #2.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.