StackOverflow 文档 VBA 教程 分配带有重复字符的字符串 使用 String 函数分配一个包含 n 个重复字符的字符串 使用 String 函数分配一个包含 n 个重复字符的字符串 Created: November-22, 2018 Dim lineOfHyphens As String 'Assign a string with 80 repeated hyphens lineOfHyphens = String$(80, "-") 使用 String 和 Space 函数分配 n 个字符的字符串分配带有重复字符的字符串