$string.Substring Index/Length exception

后端 未结 3 1571
小鲜肉
小鲜肉 2020-11-30 14:22

I\'m getting this exception when using Substring:

Exception calling \"Substring\" with \"2\" argument(s): \"Index an         


        
3条回答
  •  既然无缘
    2020-11-30 14:49

    Your first argument is that starting position in the string, and the second is the length of the substring, starting at that position. The expression for the 2 characters at positions 68 and 69 would be:

    $parameter = $string.Substring(68,2)
    

提交回复
热议问题