对我来说它有效:
diretorio=$(echo 'test 123'*)
Run Code Online (Sandbox Code Playgroud)
但是当我在引号中使用变量时却没有用
Var2="test 123"
diretorio=$(echo '$Var2'*)
Run Code Online (Sandbox Code Playgroud)
怎么解决?
我正在尝试开发一个代码来限制TextBox使用C#只允许数字输入+逗号(",")或点(".")+点或逗号后只有2个数字所以这样看到可以输入的数字:
3213,04 = OK
3211,664 = Not
32.31 = OK
32.3214 = Not
334,,00 = Not
3247,.00 = Not
214.,00 = Not
32.. = Not
8465,0 = Ok
654.0 = Ok
Run Code Online (Sandbox Code Playgroud)
明白了我的目标?我开发了代码
private void txtValormetrocubico_KeyPress(object sender, KeyPressEventArgs e)
{
if (txtValormetrocubico.TextLength >= 0 && (e.KeyChar == (char)Keys.OemPeriod || e.KeyChar == (char)Keys.Oemcomma))
{
//tests
}
else
{
if (!char.IsControl(e.KeyChar)
&& !char.IsDigit(e.KeyChar)
&& e.KeyChar != '.' && e.KeyChar != ',')
{
e.Handled = true;
}
// only allow one decimal point
if …Run Code Online (Sandbox Code Playgroud)