为什么这段代码没有给我正确的输出?我期望输出为 decomptxt = aa"。
我输入了 02a (RLEText)" "函数 'Compressdata' 不会在所有代码路径上返回值。使用结果时,可能会在运行时发生空引用异常。”
预期结果:decomptxt = aa
这是我的代码:
x = 0
For i As Integer = 1 To Len(RLEText)
Dim st As String = RLEText
NoChars = st.Substring(x, 2)
Chars = st.Substring(x + 2, 1)
decomptxt = String.Join("", Enumerable.Repeat(Chars, NoChars))
Return decomptxt
x = x + 3