我被这段代码所困扰,为什么它不起作用?

时间:2019-10-06 16:01:57

标签: string vb.net strdup

为什么这段代码没有给我正确的输出?我期待着     输出为decomptxt = aa”。

我输入了02a(RLEText)” “函数'Compressdata'不会在所有代码路径上返回值。null     使用结果时,引用异常可能在运行时发生。”

预期结果: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

0 个答案:

没有答案
相关问题