Repeat a character n times.

      String(Nunber, Character)

   Character  A single character.
   N          The Number of repeated characters to return.

The String() function can be used in VBA or in an SQL query.

String() will return a Variant, you can also use String$() to return a String.
You should use String() if there is any chance of a Null value, since assigning Null to a String will raise an error.


Dim strDemo as String
strDemo = String(10, "A")
Msgbox strDemo

“Begin at the beginning, the King said, very gravely, and go on till you come to the end: then stop” ~ Lewis Carroll


Mid - Extract a substring from a string
Right - Extract a substring from a string

Copyright © 1999-2024
Some rights reserved