strange compiler error when converting string literal (URL) into string

时间:2015-07-29 00:07:50

标签: c# url

Function Alphabetize(vStrings As Variant, separator As String) As String

    Dim v As Variant, vSorted As Variant
    Dim i As Long, j As Long, n As Long
    Dim bDone As Boolean

    For Each v In vStrings
        n = n + 1
    Next
    ReDim vSorted(1 To n)
    ReDim pos(1 To n)
    For Each v In vStrings
         i = i + 1
         vSorted(i) = v
    Next
    For j = 2 To n
         bDone = True
         For i = 2 To n
             If vSorted(i) < vSorted(i - 1) Then
                 v = vSorted(i - 1)
                 vSorted(i - 1) = vSorted(i)
                 vSorted(i) = v
                 bDone = False
             End If
         Next
         If bDone Then Exit For
    Next
    For i = 1 To n
         If vSorted(i) <> "" Then
             If i = 1 Then
                 Alphabetize = separator & vSorted(i)
             Else
                 If vSorted(i) <> vSorted(i - 1) Then Alphabetize = Alphabetize & separator & vSorted(i)
             End If
         End If
    Next
    Alphabetize = Mid$(Alphabetize, 2)
End Function

causes compiler error "CS1010 Newline in constant"

2 个答案:

答案 0 :(得分:0)

I think the strange closing double-quotation is causing the issue. Probably you copy-pasted the string from somewhere.

Please replace the character with correct double-quotation.

答案 1 :(得分:0)

会导致此问题,请改用"

enter image description here