小编fel*_*mao的帖子

变量中的通配符,Shell bash,怎么办?变量= $变量2*

对我来说它有效:

diretorio=$(echo 'test 123'*)
Run Code Online (Sandbox Code Playgroud)

但是当我在引号中使用变量时却没有用

Var2="test 123" 
diretorio=$(echo '$Var2'*)
Run Code Online (Sandbox Code Playgroud)

怎么解决?

variables bash shell wildcard

3
推荐指数
2
解决办法
1万
查看次数

如何限制C#中的文本框仅在"."之后接收数字和(点"."或逗号",").或","只允许2个数字字符

我正在尝试开发一个代码来限制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)

c# numbers comma restrict

2
推荐指数
1
解决办法
3万
查看次数

标签 统计

bash ×1

c# ×1

comma ×1

numbers ×1

restrict ×1

shell ×1

variables ×1

wildcard ×1