Function Formats Justifies Class

WrapEachCharacter

Adds some string before and some string after each character in another string.

Signature (Visual Basic / VBA)

Public Function WrapEachCharacter( _
      ByVal vValue As Variant _
    , Optional ByVal vPrefix As Variant _
    , Optional ByVal vSuffix As Variant _
    ) As Variant

Code Example

    WrapEachCharacter("123", "B", "A") = "B1AB2AB3A"
    WrapEachCharacter("123", "_" + Chr$(8)) = "_" + Chr$(8) + "1_" + Chr$(8) + "2_" + Chr$(8) + "3"

Parameters

Parameter Description
vValue The strings whose characters are to each have some prefix and/or suffix string added to them. Function returns Null if vValue is Null or cannot be fixed up to a String.
vPrefix The string which should be added as a prefix to each of the characters in string vValue. vPrefix defaults to an empty string if it is missing or Null or cannot be fixed up to a String.
vSuffix The string which should be added as a suffix to each of the characters in string vValue. vSuffix defaults to an empty string if it is missing or Null or cannot be fixed up to a String.