-1

我有一个像这样的 html 地址行:

Addressline1<br>Addressline2<br>...

如何将它们拆分为数组?

我已经使用了这段代码,但它只返回一些字符

                    Dim addressLine As String() = "Address1<br>Address2<br>".Split(New String() {"<br>"}, StringSplitOptions.RemoveEmptyEntries)

                    For index As Integer = 0 To addressLine.Count - 1
                        Dim address As String = "Address" + (index + 1).ToString()
                        Console.WriteLine(address(index))
                    Next
4

2 回答 2

3

您的拆分有效,但是您的循环没有意义(不确定您要对此做什么)。如果您修复此问题,它将输出正确的值:

For index As Integer = 0 To addressLine.Count - 1
    Console.WriteLine(addressLine(index))
Next
于 2012-07-18T13:13:09.023 回答
1
Dim Address As String() = addressLine.Split("<br>")
于 2012-07-18T12:59:51.277 回答