解释一下这句话 [英] Explain me this line
本文介绍了解释一下这句话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pr.StartInfo.Arguments = i.SubItems(3).Text.Remove(i.SubItems(3).Text.LastIndexOf("\") + 1, _
(i.SubItems(3).Text.Length - i.SubItems(3).Text.LastIndexOf("\") - 1))
子项目(3).text仅供参考:C:\Program Files(x86)\ Internet下载管理器\IDMAN。 exe
The subitems(3).text is for exemple : C:\Program Files (x86)\Internet Download Manager\IDMAN.exe
推荐答案
从最后出现的\
字符中删除字符串的最后部分(不包括在内) )。
你可以把它重写为
Removes the final part of the string, from the last occurring"\"
character (excluded).
You may re-write it as
s.Remove(s.LastIndexOf("\") + 1, s.Lenght - s.LastIndexOf("\") - 1)
其中 s.LastIndexOf(\)
是最后一个\
字符的索引,因此
s.Lenght -s.LastIndexOf( \) - 1
是最后一个\
之后的字符数。
请参阅 String.Remove方法(Int32,Int32) [ ^ ]。
where s.LastIndexOf("\")
is the index of the last occurring "\"
character, hence
s.Lenght -s.LastIndexOf("\")-1
is the number of characters following the last "\"
.
See String.Remove Method (Int32, Int32)[^].
这篇关于解释一下这句话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文