Split string into array of characters?

Safest & simplest is to just loop; Dim buff() As String ReDim buff(Len(my_string) – 1) For i = 1 To Len(my_string) buff(i – 1) = Mid$(my_string, i, 1) Next If your guaranteed to use ansi characters only you can; Dim buff() As String buff = Split(StrConv(my_string, vbUnicode), Chr$(0)) ReDim Preserve buff(UBound(buff) – 1)

Multiline strings in VB.NET

You can use XML Literals to achieve a similar effect: Imports System.XML Imports System.XML.Linq Imports System.Core Dim s As String = <a>Hello World</a>.Value Remember that if you have special characters, you should use a CDATA block: Dim s As String = <![CDATA[Hello World & Space]]>.Value 2015 UPDATE: Multi-line string literals were introduced in Visual Basic … Read more

Repeat string to certain length

Jason Scheirer’s answer is correct but could use some more exposition. First off, to repeat a string an integer number of times, you can use overloaded multiplication: >>> ‘abc’ * 7 ‘abcabcabcabcabcabcabc’ So, to repeat a string until it’s at least as long as the length you want, you calculate the appropriate number of repeats … Read more