<-- Previous || Up || Next -->

Capitalize Like Function
Character Types Class

Public Function CapitalizeLike( _
      ByVal vString As Variant _
    , ByVal vPattern As Variant _
    ) As Variant

Capitalize vString according to how corresponding characters in vPattern are capitalized.

Examples:
    CapitalizeLike("attaboy", "AbCdEfGhIj") = "AtTaBoY"
    CapitalizeLike("attaboy", "ABCD") = "ATTAboy"
    CapitalizeLike("attaboy", "ABC123ABC") = "ATTaboY"
    CapitalizeLike("ATTABOY", "abc123abc") = "attABOy"
See also:
    RandomCapitalize Function
    SwapUpperAndLowerCase Function
vString: 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.