【问题标题】:i want to trim a rupee symbol but its not working in a single quote我想修剪一个卢比符号,但它在单引号中不起作用
【发布时间】:2016-01-22 00:58:10
【问题描述】:
private void paymentHasMade (object sender, EventArgs e)   
{
   decimal total= 0;
   try
   {
      total = decimal.Parse (txtamounttopay.Text.TrimStart('रु')) - decimal.Parse(txtpaymentamount.Text);
   }
}

【问题讨论】:

  • Text 中的内容是什么?
  • 它显示错误:字符文字中的字符过多
  • 我的意思是文本框的输入是什么
  • 在文本中返回一个数值
  • 显示即将到来的内容?

标签: c# winforms


【解决方案1】:

请改用string.Replace

total = decimal.Parse (txtamounttopay.Text.Replace("रु", string.Empty)) 
      - decimal.Parse(txtpaymentamount.Text);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-09
    • 1970-01-01
    • 1970-01-01
    • 2011-08-30
    • 2020-09-09
    • 1970-01-01
    • 1970-01-01
    • 2012-07-29
    相关资源
    最近更新 更多