我试图使用${string:pos}子串语法在Bash中获取字符串的后缀,但我无法弄清楚为什么它不起作用.我设法将我的示例代码简化为:
STRING="hello world"
POS=4
echo ${STRING:POS} # prints "o world"
echo ${STRING:4} # prints "o world"
POS=-4
echo ${STRING:POS} # prints "orld"
echo ${STRING:-4} # prints "hello world"
Run Code Online (Sandbox Code Playgroud)
前三行完全按照我的预期工作,但为什么最后一行打印"hello world"而不是"orld"?
有了zypper,我可以得到包A取决于包B.但是,我需要知道的是哪些包依赖于包B.
有没有办法生成反向依赖列表?
我想在 中选择多个项目ListBox,但浏览器要求用户按 CTRL 选择多个项目,否则它只选择一个项目。
我想在不按 CTRL 的情况下选择多个项目,并且我不想使用CheckBoxList. 有没有更好的方法来做到这一点?使用纯 javascript、JQuery 或 Codebehind。
(我已经SelectionMode="Multiple"为ListBox控件添加了属性)
代码:
<asp:ListBox ID="ListBox1" runat="server" Height="210px" Width="203px" SelectionMode="Multiple">
<asp:ListItem>1000</asp:ListItem>
<asp:ListItem>2000</asp:ListItem>
<asp:ListItem>4000</asp:ListItem>
<asp:ListItem>4000</asp:ListItem>
<asp:ListItem>5000</asp:ListItem>
<asp:ListItem>6000</asp:ListItem>
</asp:ListBox>
Run Code Online (Sandbox Code Playgroud)