String Function

Returns a string filled with a repeated sub-string to a fixed length.

String (length, char)

Parameters

Length  -  (Input, expression, Required)

Specifies the final length of the string.

Char  -  (Input, expression, Required)

Specifies the character or sub-string to repeat.

Return Value

A fixed-length string filled with the specified character(s).

Examples

String (5, “a”)

Returns “aaaaa”

String (5, “abc”)

Returns “abcab”

String (2, “abc”)

Returns “ab”

String (5, “”)

Returns “”

String (0, “abc”)

Returns “”

String (-1, “abc”)

Returns Error

String (5, Null)

Returns “”

String (5, Error)

Returns Error

TIP:

Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.

See Also

Functions | Asc function | Chr function | CSet function | Format function | InStr function | LCase function | Left function | Len function | LSet function | LTrim function | Mid function | Replace function | Right function | RSet function | RTrim function | Space function | String function | TCase function | Trim function | UBound function | UCase function


© 2004-2021 looksoftware. All rights reserved.