我尝试使用以下代码将字符串划分为相等的艺术,每一个 2 个字母,但它没有用:
Dim twoLetterWords = "The quick fox jumped over the lazy dog".
Select(Function(c, i) New With {.Char = c, .Index = i}).
GroupBy(Function(x) CInt(Math.Floor(x.Index / 2))).
Select(Function(g) String.Join("", g.Select(Function(x) x.Char)))
我还尝试了以下方法:
Dim n As Integer
Dim sasa(69) As String
For i As Integer = 0 To sasa.Length - 1
sasa(i) = "das"
Next
For i As Integer = 0 To RichTextBox1.TextLength - 2 Step 2
For x As Integer = 0 To sasa.Length - 1
n = i + 2
sasa(x) = RichTextBox1.Text.Substring(i, 2)
For z As Integer = 1 To 3
RichTextBox2.Text = RichTextBox2.Text
Next z
Next x
Next i
但这也是徒劳的。那么,我误会了什么?或者还有其他方法可以做我想做的事情吗?